def _get_nodes(pred, i, j):
        r"""return node IDs of a path from i to j given predecessors"""
        if i == j:
            return []
        prev = pred[j]
        nodes = [j, prev]
        while prev != i:
            prev = pred[prev]
            nodes.append(prev)
        nodes.reverse()

        return nodes
return node IDs of a path from i to j given predecessors
python/dgl/transforms/functional.py