code: def array_from_json(value, obj=None):
      if value is not None:
          # this will accept regular json data, like an array of values, which can be useful it you want
          # to link bqplot to other libraries that use that
          if isinstance(value, list):
              if len(value) > 0 and (
                  isinstance(value[0], dict) and "value" in value[0]
              ):
                  subarrays = [array_from_json(k) for k in value]
                  if len(subarrays) > 0:
                      expected_length = len(subarrays[0])
                      # if a 'ragged' array, we should explicitly pass dtype=object
                      if any(
                          len(k) != expected_length
                          for k in subarrays[1:]
                      ):
                          return np.array(subarrays, dtype=object)
                  return np.array(subarrays)
              elif len(value) > 0 and isinstance(value[0], list):
                  return np.array(value, dtype=object)
              else:
                  return np.array(value)
          elif "value" in value:
              try:
                  ar = np.frombuffer(
                      value["value"], dtype=value["dtype"]
                  ).reshape(value["shape"])
              except AttributeError:
                  # in some python27/numpy versions it does not like the memoryview
                  # we go the .tobytes() route, but since i'm not 100% sure memory copying
                  # is happening or not, we one take this path if the above fails.
                  ar = np.frombuffer(
                      value["value"].tobytes(), dtype=value["dtype"]
                  ).reshape(value["shape"])
              if value.get("type") == "date":
                  assert value["dtype"] == "float64"
                  ar = ar.astype("datetime64[ms]")
              return ar
  
imports: from traitlets import TraitError, TraitType
  import numpy
  import pandas
  import warnings
  import datetime
  import six
label_desc: Use image node_id 4 for calling a global function with example usage: array_from_json(value, obj) and returns: np, ar, np, np, np