code: def get_names_flat(adtype):
      """
      Returns the field names of the input datatype as a tuple. Input datatype
      must have fields otherwise error is raised.
      Nested structure are flattened beforehand.
  
      Parameters
      ----------
      adtype : dtype
          Input datatype
  
      Examples
      --------
      >>> from numpy.lib import recfunctions as rfn
      >>> rfn.get_names_flat(np.empty((1,), dtype=[('A', int)]).dtype) is None
      False
      >>> rfn.get_names_flat(np.empty((1,), dtype=[('A',int), ('B', str)]).dtype)
      ('A', 'B')
      >>> adtype = np.dtype([('a', int), ('b', [('ba', int), ('bb', int)])])
      >>> rfn.get_names_flat(adtype)
      ('a', 'b', 'ba', 'bb')
      """
      listnames = []
      names = adtype.names
      for name in names:
          listnames.append(name)
          current = adtype[name]
          if current.names is not None:
              listnames.extend(get_names_flat(current))
      return tuple(listnames)
  
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 5 for calling a global function with example usage: get_names_flat(adtype) and returns: tuple