code: def _freeze(obj):
      """
      Recursively freeze the given object so that it might be suitable for
      use as a hashable.
  
      """
      if isinstance(obj, dict):
          obj = frozenset(((k, _freeze(v)) for k, v in obj.items()))
      elif isinstance(obj, list):
          obj = tuple(_freeze(item) for item in obj)
      elif isinstance(obj, np.ndarray):
          obj = tuple(obj)
      return obj
  
file_path: cartopy/lib/cartopy/mpl/feature_artist.py
imports: from collections import OrderedDict
  import warnings
  import weakref
  import matplotlib.artist
  import matplotlib.collections
  import numpy
  import cartopy.mpl.patch
  from .style import finalize
  from .style import merge
label_desc: Use image node_id 1 for calling a global function with example usage: _freeze(obj) and returns: obj