def uniquify_str(str_, str_set):
    "Uniquifies :attr:`str_` if :attr:`str_` is included in :attr:`str_set`.\n\n    This is done by appending a number to :attr:`str_`. Returns\n    :attr:`str_` directly if it is not included in :attr:`str_set`.\n\n    Args:\n        str_ (string): A string to uniquify.\n        str_set (set, dict, or list): A collection of strings. The returned\n            string is guaranteed to be different from the elements in the\n            collection.\n\n    Returns:\n        The uniquified string. Returns :attr:`str_` directly if it is\n        already unique.\n\n    Example:\n\n        .. code-block:: python\n\n            print(uniquify_str('name', ['name', 'name_1']))\n            # 'name_2'\n\n    "
    if (str_ not in str_set):
        return str_
    else:
        for i in range(1, (len(str_set) + 1)):
            unique_str = (str_ + ('_%d' % i))
            if (unique_str not in str_set):
                return unique_str
    raise ValueError(('Fails to uniquify string: ' + str_))
Uniquifies :attr:`str_` if :attr:`str_` is included in :attr:`str_set`.

This is done by appending a number to :attr:`str_`. Returns
:attr:`str_` directly if it is not included in :attr:`str_set`.

Args:
    str_ (string): A string to uniquify.
    str_set (set, dict, or list): A collection of strings. The returned
        string is guaranteed to be different from the elements in the
        collection.

Returns:
    The uniquified string. Returns :attr:`str_` directly if it is
    already unique.

Example:

    .. code-block:: python

        print(uniquify_str('name', ['name', 'name_1']))
        # 'name_2'
def uniquify_str(str_, str_set):
    "Uniquifies :attr:`str_` if :attr:`str_` is included in :attr:`str_set`.\n\n    This is done by appending a number to :attr:`str_`. Returns\n    :attr:`str_` directly if it is not included in :attr:`str_set`.\n\n    Args:\n        str_ (string): A string to uniquify.\n        str_set (set, dict, or list): A collection of strings. The returned\n            string is guaranteed to be different from the elements in the\n            collection.\n\n    Returns:\n        The uniquified string. Returns :attr:`str_` directly if it is\n        already unique.\n\n    Example:\n\n        .. code-block:: python\n\n            print(uniquify_str('name', ['name', 'name_1']))\n            # 'name_2'\n\n    "
    if (str_ not in str_set):
        return str_
    else:
        for i in range(1, (len(str_set) + 1)):
            unique_str = (str_ + ('_%d' % i))
            if (unique_str not in str_set):
                return unique_str
    raise ValueError(('Fails to uniquify string: ' + str_))