code: def pack_values(values):
      """Used the clean up arrays before putting them into an Explanation object."""
  
      if not hasattr(values, "__len__"):
          return values
  
      # collapse the values if we didn't compute them
      if values is None or values[0] is None:
          return None
  
      # convert to a single numpy matrix when the array is not ragged
      elif (
          np.issubdtype(type(values[0]), np.number)
          or len(np.unique([len(v) for v in values])) == 1
      ):
          return np.array(values)
      else:
          return np.array(values, dtype=object)
  
imports: import copy
  import time
  import numpy
  import pandas
  import scipy.sparse
  from ..None import explainers, links, maskers, models
  from .._explanation import Explanation
  from .._serializable import Deserializer, Serializable, Serializer
  from ..maskers import Masker
  from ..models import Model
  from ..utils import safe_isinstance, show_progress
  from ..utils._exceptions import InvalidAlgorithmError
  from ..utils.transformers import is_transformers_lm
label_desc: Use image node_id 1 for calling a global function with example usage: pack_values(values) and returns: values, None, np, np