def addAttributes(parent, **attr):
    """
    add attributes to an h5py data item

    :param obj parent: h5py parent object
    :param dict attr: optional dictionary of attributes
    """
    if isinstance(attr, dict):
        for k, v in attr.items():
            parent.attrs[k] = v
