code: def _get_fieldspec(dtype):
      """
      Produce a list of name/dtype pairs corresponding to the dtype fields
  
      Similar to dtype.descr, but the second item of each tuple is a dtype, not a
      string. As a result, this handles subarray dtypes
  
      Can be passed to the dtype constructor to reconstruct the dtype, noting that
      this (deliberately) discards field offsets.
  
      Examples
      --------
      >>> dt = np.dtype([(('a', 'A'), np.int64), ('b', np.double, 3)])
      >>> dt.descr
      [(('a', 'A'), '<i8'), ('b', '<f8', (3,))]
      >>> _get_fieldspec(dt)
      [(('a', 'A'), dtype('int64')), ('b', dtype(('<f8', (3,))))]
  
      """
      if dtype.names is None:
          # .descr returns a nameless field, so we should too
          return [("", dtype)]
      else:
          fields = ((name, dtype.fields[name]) for name in dtype.names)
          # keep any titles, if present
          return [
              (name if len(f) == 2 else (f[2], name), f[0])
              for name, f in fields
          ]
  
imports: import itertools
  import numpy
  import numpy.ma
  from numpy import ndarray
  from numpy.ma import MaskedArray
  from numpy.ma.mrecords import MaskedRecords
  from numpy._core.overrides import array_function_dispatch
  from numpy._core.records import recarray
  from numpy.lib._iotools import _is_string_like
label_desc: Use image node_id 3 for calling a global function with example usage: _get_fieldspec(dtype) and returns: list, unknown