def METHOD_NAME(key, group):
    if key in group:
        val = group[key]
    elif key + '__from_list__' in group:
        key = key + '__from_list__'
        val = group[key]
    else:
        return None
    if isinstance(val, h5py.Group):
        if key.endswith('__from_list__'):
            return [METHOD_NAME(k, val) for k in val]
        else:
            return dict([(k.replace('__from_list__', ''),
                          METHOD_NAME(k, val)) for k in val])
    else:
        return val[()]