code: def dtype_to_descr(dtype):
      """
      Get a serializable descriptor from the dtype.
  
      The .descr attribute of a dtype object cannot be round-tripped through
      the dtype() constructor. Simple types, like dtype('float32'), have
      a descr which looks like a record array with one field with '' as
      a name. The dtype() constructor interprets this as a request to give
      a default name.  Instead, we construct descriptor that can be passed to
      dtype().
  
      Parameters
      ----------
      dtype : dtype
          The dtype of the array that will be written to disk.
  
      Returns
      -------
      descr : object
          An object that can be passed to `numpy.dtype()` in order to
          replicate the input dtype.
  
      """
      if dtype.names is not None:
          # This is a record array. The .descr is fine.  XXX: parts of the
          # record array with an empty name, like padding bytes, still get
          # fiddled with. This needs to be fixed in the C implementation of
          # dtype().
          return dtype.descr
      else:
          return dtype.str
  
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 4 for calling a global function with example usage: dtype_to_descr(dtype) and returns: dtype, dtype