def get_component(dataset: InMemoryDataset, start: int=0) -> set:
    visited_nodes = set()
    queued_nodes = set([start])
    (row, col) = dataset.data.edge_index.numpy()
    while queued_nodes:
        current_node = queued_nodes.pop()
        visited_nodes.update([current_node])
        neighbors = col[np.where((row == current_node))[0]]
        neighbors = [n for n in neighbors if ((n not in visited_nodes) and (n not in queued_nodes))]
        queued_nodes.update(neighbors)
    return visited_nodes
def get_component(dataset: InMemoryDataset, start: int=0) -> set:
    visited_nodes = set()
    queued_nodes = set([start])
    (row, col) = dataset.data.edge_index.numpy()
    while queued_nodes:
        current_node = queued_nodes.pop()
        visited_nodes.update([current_node])
        neighbors = col[np.where((row == current_node))[0]]
        neighbors = [n for n in neighbors if ((n not in visited_nodes) and (n not in queued_nodes))]
        queued_nodes.update(neighbors)
    return visited_nodes