code: def convert_collection_to_dict(collection, clear_collection=False):
      """Returns an OrderedDict of Tensors with their aliases as keys.
  
      Args:
        collection: A collection.
        clear_collection: When True, it clears the collection after converting to
          OrderedDict.
  
      Returns:
        An OrderedDict of {alias: tensor}
      """
      output = OrderedDict(
          (alias, tensor)
          for tensor in ops.get_collection(collection)
          for alias in get_tensor_aliases(tensor)
      )
      if clear_collection:
          ops.get_default_graph().clear_collection(collection)
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import namedtuple
  from collections import OrderedDict
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 5 for calling a global function with example usage: convert_collection_to_dict(collection, clear_collection) and returns: output