code: def fast_hash(
      obj, hash_name="xxhash", coerce_mmap=False, protocol=None
  ):
      """Quick calculation of a hash to identify uniquely Python objects
      containing numpy arrays.
  
      Compared to default joblib, this function uses the xxhash algorithm,
      hashes in O(1) space and has special handling for object arrays.
  
      Parameters
      -----------
      coerce_mmap: boolean
          Make no difference between np.memmap and np.ndarray
      protocol: int
          Pickle protocol version to use
      """
      valid_hash_names = ("xxhash", "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 "pandas" in sys.modules:
          hasher = FastPandasHasher(
              hash_name=hash_name,
              coerce_mmap=coerce_mmap,
              protocol=protocol,
          )
      elif "numpy" in sys.modules:
          hasher = FastNumpyHasher(
              hash_name=hash_name,
              coerce_mmap=coerce_mmap,
              protocol=protocol,
          )
      else:
          hasher = FastHasher(hash_name=hash_name, protocol=protocol)
      return hasher.hash(obj)
  
imports: import hashlib
  import pickle
  import struct
  import sys
  import tempfile
  import time
  import traceback
  from pathlib import Path
  from typing import TYPE_CHECKING, Union
  from joblib.hashing import Hasher, Pickler
  from joblib.memory import MemorizedFunc, MemorizedResult, Memory, NotMemorizedResult, _format_load_msg, filter_args, format_call, format_signature, format_time, get_func_name
  from xxhash import xxh128
label_desc: Use image node_id 1 for calling a global function with example usage: fast_hash(obj, hash_name, coerce_mmap, protocol) and returns: hasher