def _format_metadata_attribute(value):
if (value is None or<EOL>(isinstance(value, Index) and value.regular)):<EOL><INDENT>raise IgnoredAttribute<EOL><DEDENT>for typekey, func in ATTR_TYPE_MAP.items():<EOL><INDENT>if issubclass(type(value), typekey):<EOL><INDENT>return func(value)<EOL><DEDENT><DEDENT>return value<EOL>
Format a value for writing to HDF5 as a `h5py.Dataset` attribute