code: def should_pickle(key, val):
      """
      Checks if a dictionary item can be pickled
  
      Parameters
      ----------
      key : try
          key for dictionary element
      val : None
          element of dictionary
  
      Returns
      -------
      picklable: bool
          whether the dictionary item can be pickled
      """
      try:
          ## make sure object can be pickled and then re-read
          # pickle object
          pickled = codecs.encode(pickle.dumps(val), "base64").decode()
          # unpickle object
          unpickled = pickle.loads(
              codecs.decode(pickled.encode(), "base64")
          )
      except (
          pickle.PicklingError,
          tf.errors.InvalidArgumentError,
          TypeError,
          tf.errors.InternalError,
          tf.errors.NotFoundError,
          OverflowError,
          TypingError,
          AttributeError,
      ) as e:
          warn("Did not pickle {}: {}".format(key, e))
          return False
      except ValueError as e:
          warn(f"Failed at pickling {key}:{val} due to {e}")
          return False
      return True
  
imports: import numpy
  from umap import UMAP
  from warnings import warn, catch_warnings, filterwarnings
  from numba import TypingError
  import os
  from umap.spectral import spectral_layout
  from sklearn.utils import check_random_state
  import codecs, pickle
  from sklearn.neighbors import KDTree
  import sys
label_desc: Use image node_id 9 for calling a global function with example usage: should_pickle(key, val) and returns: True, False, False