code: def hashable_structure(struct):
      """Hashes a possibly mutable structure of `Tensor`s."""
  
      def make_hashable(obj):
          if isinstance(
              obj,
              (HashableWeakRef, WeakStructRef, ObjectIdentityWrapper),
          ):
              return obj
          elif isinstance(obj, np.ndarray):
              obj_hash = hash(
                  str(obj.__array_interface__) + str(id(obj))
              )
              return ObjectIdentityWrapper(obj, object_hash=obj_hash)
          elif tf.is_tensor(obj):
              return ObjectIdentityWrapper(obj)
          try:
              hash(obj)
              return obj
          except TypeError:
              return ObjectIdentityWrapper(obj)
  
      # Flatten structs into a tuple of tuples to make mutable containers hashable.
      return tuple(
          (k, make_hashable(v))
          for k, v in nest.flatten_with_tuple_paths(struct)
      )
  
imports: import collections
  import weakref
  import numpy
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: hashable_structure(struct) and returns: tuple, obj, obj, ObjectIdentityWrapper, ObjectIdentityWrapper, ObjectIdentityWrapper