<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_metadata_attribute(value):
 """Format a value for writing to HDF5 as a `h5py.Dataset` attribute """

    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