def METHOD_NAME(name, names):
    if name not in names:
        return None
    regex = r'^.* \(([0-9]*)\)$'
    match = re.match(regex, name)
    if match is None:
        name += ' (2)'
        if name in names:
            match = re.match(regex, name)
    while match is not None:
        num = int(match.groups()[0])
        name = name[:name.rfind('(')] + '({})'.format(num + 1)
        if name not in names:
            return name
        match = re.match(regex, name)
    return name