parameters: (rec)
return_statement: return np.dtype(fields, align=rec.aligned)
docstring: Convert Numba Record type to NumPy structured dtype
docstring_summary: Convert Numba Record type to NumPy structured dtype
docstring_tokens: Convert Numba Record type to NumPy structured dtype
function: def as_struct_dtype(rec):
      """Convert Numba Record type to NumPy structured dtype
      """
      assert isinstance(rec, types.Record)
      names = []
      formats = []
      offsets = []
      titles = []
      # Fill the fields if they are not a title.
      for k, t in rec.members:
          if not rec.is_title(k):
              names.append(k)
              formats.append(as_dtype(t))
              offsets.append(rec.offset(k))
              titles.append(rec.fields[k].title)
  
      fields = {
          'names': names,
          'formats': formats,
          'offsets': offsets,
          'itemsize': rec.size,
          'titles': titles,
      }
      _check_struct_alignment(rec, fields)
      return np.dtype(fields, align=rec.aligned)
function_tokens: def as_struct_dtype ( rec ) : assert isinstance ( rec , types . Record ) names = [ ] formats = [ ] offsets = [ ] titles = [ ] # Fill the fields if they are not a title. for k , t in rec . members : if not rec . is_title ( k ) : names . append ( k ) formats . append ( as_dtype ( t ) ) offsets . append ( rec . offset ( k ) ) titles . append ( rec . fields [ k ] . title ) fields = { 'names' : names , 'formats' : formats , 'offsets' : offsets , 'itemsize' : rec . size , 'titles' : titles , } _check_struct_alignment ( rec , fields ) return np . dtype ( fields , align = rec . aligned )