def revert_to_homo(d: dict):
    """Utility function to convert a dictionary that stores homogenous data."""
    is_homogenous = len(d) == 1 and "_N" in d
    return list(d.values())[0] if is_homogenous else d
Utility function to convert a dictionary that stores homogenous data.
python/dgl/graphbolt/subgraph_sampler.py