import re


def model_ids(source):
    """Returns a set of model identifiers found in the passed *source*."""
    model_id_re = re.compile('/((?:tt|nm)\d+)')
    return set(model_id_re.findall(source))