code: def unique_object_name(
      name,
      name_uid_map=None,
      avoid_names=None,
      namespace="",
      zero_based=False,
  ):
      """Makes a object name (or arbitrary string) unique within a TensorFlow graph.
      Arguments:
        name: String name to make unique.
        name_uid_map: An optional defaultdict(int) to use when creating unique
          names. If None (default), uses a per-Graph dictionary.
        avoid_names: An optional set or dict with names which should not be used. If
          None (default) does not avoid any names.
        namespace: Gets a name which is unique within the (graph, namespace). Layers
          which are not Networks use a blank namespace and so get graph-global
          names.
        zero_based: If True, name sequences start with no suffix (e.g. "dense",
          "dense_1"). If False, naming is one-based ("dense_1", "dense_2").
      Returns:
        Unique string name.
      Example:
      ```python
      _unique_layer_name('dense')  # dense_1
      _unique_layer_name('dense')  # dense_2
      ```
      """
      if name_uid_map is None:
          name_uid_map = _get_default_graph_uid_map()
      if avoid_names is None:
          avoid_names = set()
      proposed_name = None
      while proposed_name is None or proposed_name in avoid_names:
          name_key = (namespace, name)
          if zero_based:
              number = name_uid_map[name_key]
              if number:
                  proposed_name = name + "_" + str(number)
              else:
                  proposed_name = name
              name_uid_map[name_key] += 1
          else:
              name_uid_map[name_key] += 1
              proposed_name = name + "_" + str(name_uid_map[name_key])
      return proposed_name
  
imports: import collections
  import weakref
  from tensorflow.python.framework import ops
label_desc: Use image node_id 2 for calling a global function with example usage: unique_object_name(name, name_uid_map, avoid_names, namespace, zero_based) and returns: proposed_name