code: def build_header(dtype):
      
      header = _build_header(dtype, ())
      h = []
      for col in header:
          name = '~'.join(col[:-2])
          numpytype = col[-2]
          shape = col[-1]
          coldescr = name
          if numpytype != 'float32' and not numpytype.startswith('|S'):
              coldescr += ':' + numpytype
          if shape:
              coldescr += ':' + ':'.join(map(str, shape))
          h.append(coldescr)
      return h
docs: Convert a numpy nested dtype into a list of strings suitable as header
      of csv file.
  
      >>> imt_dt = numpy.dtype([('PGA', numpy.float32, 3),
      ...                       ('PGV', numpy.float32, 4)])
      >>> build_header(imt_dt)
      ['PGA:3', 'PGV:4']
      >>> gmf_dt = numpy.dtype([('A', imt_dt), ('B', imt_dt),
      ...                       ('idx', numpy.uint32)])
      >>> build_header(gmf_dt)
      ['A~PGA:3', 'A~PGV:4', 'B~PGA:3', 'B~PGV:4', 'idx:uint32']