def get_dic(f, dataset="spectrum"):
    """
    Get a dictionary from dataset in a HDF5 File
    """

    # select the data set
    dset = f[dataset]

    dic = {}
    # loop over the attributes
    for key, value in dset.attrs.items():

        if "_" in key:
            # we have an axis key
            axis, subkey = key.split("_", 1)
            axis = int(axis)
            if axis == dic:
                dic[axis] = {}
            dic[axis][subkey] = value
        else:
            dic[key] = value

    return dic
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/glue.py/get_dic/operator `not in` -> `==`