def METHOD_NAME(self, name: str) -> str:
    """
    Returns a unique operation name for `name`.
    For more details, please, see implementation of
    the `tf.Graph.unique_name()` method.
    :param name: The name for an operation.
    :return: Unique name.
    """
    name_key = name.lower()
    i = self.names_in_use.get(name_key, 0)
    self.names_in_use[name_key] = i + 1
    if i > 0:
        base_name_key = name_key
        # Make sure the composed name key is not already used.
        while name_key in self.names_in_use:
            name_key = f"{base_name_key}_{i}"
            i += 1
        # Mark the composed name_key as used in case someone wants
        # to call unique_name('name_1').
        self.names_in_use[name_key] = 1
        # Return the new name with the original capitalization of the given name.
        name = f"{name}_{i - 1}"
    return name