code: def descr_to_dtype(descr):
      """
      descr may be stored as dtype.descr, which is a list of
      (name, format, [shape]) tuples where format may be a str or a tuple.
      Offsets are not explicitly saved, rather empty fields with
      name, format == '', '|Vn' are added as padding.
  
      This function reverses the process, eliminating the empty padding fields.
      """
      if isinstance(descr, str):
          # No padding removal needed
          return numpy.dtype(descr)
      elif isinstance(descr, tuple):
          # subtype, will always have a shape descr[1]
          dt = descr_to_dtype(descr[0])
          return numpy.dtype((dt, descr[1]))
      fields = []
      offset = 0
      for field in descr:
          if len(field) == 2:
              name, descr_str = field
              dt = descr_to_dtype(descr_str)
          else:
              name, descr_str, shape = field
              dt = numpy.dtype((descr_to_dtype(descr_str), shape))
  
          # Ignore padding bytes, which will be void bytes with '' as name
          # Once support for blank names is removed, only "if name == ''" needed)
          is_pad = (
              name == "" and dt.type is numpy.void and dt.names is None
          )
          if not is_pad:
              fields.append((name, dt, offset))
  
          offset += dt.itemsize
  
      names, formats, offsets = zip(*fields)
      # names may be (title, names) tuples
      nametups = (
          n if isinstance(n, tuple) else (None, n) for n in names
      )
      titles, names = zip(*nametups)
      return numpy.dtype(
          {
              "names": names,
              "formats": formats,
              "titles": titles,
              "offsets": offsets,
              "itemsize": offset,
          }
      )
  
imports: from __future__ import division, absolute_import, print_function
  import numpy
  import sys
  import io
  import warnings
  from numpy.lib.utils import safe_eval
  from numpy.compat import asbytes, asstr, isfileobj, long, os_fspath
  from numpy.core.numeric import pickle
label_desc: Use image node_id 5 for calling a global function with example usage: descr_to_dtype(descr) and returns: numpy, numpy, numpy