code: def _format_metadata_attribute(value):
      
      if (value is None or
              (isinstance(value, Index) and value.regular)):
          raise IgnoredAttribute
  
      # map type to something HDF5 can handle
      for typekey, func in ATTR_TYPE_MAP.items():
          if issubclass(type(value), typekey):
              return func(value)
      return value
docs: Format a value for writing to HDF5 as a `h5py.Dataset` attribute