code: def build_header(dataset):
      """Build header dictionary of metadata for the tensors in the dataset. This will be used when loading
      the tfrecords file to reconstruct the original tensors from the raw data. Shape is stored as an array
      and dtype is stored as an enumerated value (defined by tensorflow).
      """
      header = {}
      for key in dataset.element_spec.keys():
          header[key] = {
              "shape": list(dataset.element_spec[key].shape),
              "dtype": dataset.element_spec[key].dtype.as_datatype_enum,
          }
  
      return header
  
file_path: io/tensorflow_io/python/experimental/serial_ops.py
imports: import functools
  import os
  import tempfile
  import numpy
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: build_header(dataset) and returns: header