def find_dps(graph: DataPipeGraph, dp_type: Type[DataPipe]) -> List[DataPipe]:
    r"""
    Given the graph of DataPipe generated by ``traverse_dps`` function, return DataPipe
    instances with the provided DataPipe type.
    """
    dps: List[DataPipe] = []
    cache: Set[int] = set()

    def helper(g) -> None:  # pyre-ignore
        for dp_id, (dp, src_graph) in g.items():
            if dp_id in cache:
                continue
            cache.add(dp_id)
            # Please not use `isinstance`, there is a bug.
            if type(dp) is dp_type:  # pylint: disable=unidiomatic-typecheck
                dps.append(dp)
            helper(src_graph)

    helper(graph)

    return dps

    Given the graph of DataPipe generated by ``traverse_dps`` function, return DataPipe
    instances with the provided DataPipe type.
    
python/dgl/graphbolt/datapipes/utils.py