def METHOD_NAME(mobj):
    thelist = conv(mobj.group(1).replace(r'\,', '@comma@'))
    if template_name_re.match(thelist):
        return "<%s>" % (thelist)
    name = None
    for key in lnames.keys():    # see if list is already in dictionary
        if lnames[key] == thelist:
            name = key
    if name is None:      # this list is not in the dictionary yet
        name = unique_key(lnames)
        lnames[name] = thelist
    return "<%s>" % name