Return a unique name based on `name_format` and `name`.

def make_unique_name(name, existing_names, name_format="{name}_{index}", start=2):
    """Return a unique name based on `name_format` and `name`."""
    index = start
    new_name = name
    while new_name in existing_names:
        new_name = name_format.format(name=name, index=index)
        index += 1

    return new_name