code: def _usefields(adict, align):
      try:
          names = adict[-1]
      except KeyError:
          names = None
      if names is None:
          names, formats, offsets, titles = _makenames_list(
              adict, align
          )
      else:
          formats = []
          offsets = []
          titles = []
          for name in names:
              res = adict[name]
              formats.append(res[0])
              offsets.append(res[1])
              if len(res) > 2:
                  titles.append(res[2])
              else:
                  titles.append(None)
  
      return dtype(
          {
              "names": names,
              "formats": formats,
              "offsets": offsets,
              "titles": titles,
          },
          align,
      )
  
imports: import ast
  import re
  import sys
  import warnings
  from ..exceptions import DTypePromotionError
  from .multiarray import dtype, array, ndarray, promote_types
label_desc: Use image node_id 2 for calling a global function with example usage: _usefields(adict, align) and returns: dtype