code: def recarray2dict(arr):
      """Convert numpy record array to a dictionary."""
      res = {}
      tcds_types = [time_cds_short, time_cds, time_cds_expanded]
  
      for dtuple in arr.dtype.descr:
          key = dtuple[0]
          ntype = dtuple[1]
          data = arr[key]
          if ntype in tcds_types:
              if data.size > 1:
                  res[key] = np.array(
                      [timecds2datetime(item) for item in data.ravel()]
                  ).reshape(data.shape)
              else:
                  res[key] = timecds2datetime(data)
          elif isinstance(ntype, list):
              res[key] = recarray2dict(data)
          else:
              if data.size == 1:
                  data = data[0]
                  if ntype[:2] == "|S":
                      # Python2 and Python3 handle strings differently
                      try:
                          data = data.decode()
                      except ValueError:
                          data = None
                      else:
                          data = data.split(":")[0].strip()
                  res[key] = data
              else:
                  res[key] = data.squeeze()
  
      return res
  
imports: from datetime import datetime, timedelta
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: recarray2dict(arr) and returns: res