import pickle


def get_type(h_node):
    """ Helper function to return the py_type for an HDF node """
    base_type = h_node.attrs['base_type']
    if base_type != b'pickle':
        py_type = pickle.loads(h_node.attrs['type'])
    else:
        py_type = None
    return py_type, base_type