code: def hash(obj, hash_name="md5", coerce_mmap=False):
      """Quick calculation of a hash to identify uniquely Python objects
      containing numpy arrays.
  
      Parameters
      ----------
      hash_name: 'md5' or 'sha1'
          Hashing algorithm used. sha1 is supposedly safer, but md5 is
          faster.
      coerce_mmap: boolean
          Make no difference between np.memmap and np.ndarray
      """
      valid_hash_names = ("md5", "sha1")
      if hash_name not in valid_hash_names:
          raise ValueError(
              "Valid options for 'hash_name' are {}. "
              "Got hash_name={!r} instead.".format(
                  valid_hash_names, hash_name
              )
          )
      if "numpy" in sys.modules:
          hasher = NumpyHasher(
              hash_name=hash_name, coerce_mmap=coerce_mmap
          )
      else:
          hasher = Hasher(hash_name=hash_name)
      return hasher.hash(obj)
  
imports: import pickle
  import hashlib
  import sys
  import types
  import struct
  import io
  import decimal
label_desc: Use image node_id 1 for calling a global function with example usage: hash(obj, hash_name, coerce_mmap) and returns: hasher