def get_dataset(name: str, use_lcc: bool=True) -> InMemoryDataset:
    path = os.path.join(DATA_PATH, name)
    if (name in ['Cora', 'Citeseer', 'Pubmed']):
        dataset = Planetoid(path, name)
    elif (name in ['Computers', 'Photo']):
        dataset = Amazon(path, name)
    elif (name == 'CoauthorCS'):
        dataset = Coauthor(path, 'CS')
    else:
        raise Exception('Unknown dataset.')
    if use_lcc:
        lcc = get_largest_connected_component(dataset)
        x_new = dataset.data.x[lcc]
        y_new = dataset.data.y[lcc]
        (row, col) = dataset.data.edge_index.numpy()
        edges = [[i, j] for (i, j) in zip(row, col) if ((i in lcc) and (j in lcc))]
        edges = remap_edges(edges, get_node_mapper(lcc))
        data = Data(x=x_new, edge_index=torch.LongTensor(edges), y=y_new, train_mask=torch.zeros(y_new.size()[0], dtype=torch.bool), test_mask=torch.zeros(y_new.size()[0], dtype=torch.bool), val_mask=torch.zeros(y_new.size()[0], dtype=torch.bool))
        dataset.data = data
    return dataset
def get_dataset(name: str, use_lcc: bool=True) -> InMemoryDataset:
    path = os.path.join(DATA_PATH, name)
    if (name in ['Cora', 'Citeseer', 'Pubmed']):
        dataset = Planetoid(path, name)
    elif (name in ['Computers', 'Photo']):
        dataset = Amazon(path, name)
    elif (name == 'CoauthorCS'):
        dataset = Coauthor(path, 'CS')
    else:
        raise Exception('Unknown dataset.')
    if use_lcc:
        lcc = get_largest_connected_component(dataset)
        x_new = dataset.data.x[lcc]
        y_new = dataset.data.y[lcc]
        (row, col) = dataset.data.edge_index.numpy()
        edges = [[i, j] for (i, j) in zip(row, col) if ((i in lcc) and (j in lcc))]
        edges = remap_edges(edges, get_node_mapper(lcc))
        data = Data(x=x_new, edge_index=torch.LongTensor(edges), y=y_new, train_mask=torch.zeros(y_new.size()[0], dtype=torch.bool), test_mask=torch.zeros(y_new.size()[0], dtype=torch.bool), val_mask=torch.zeros(y_new.size()[0], dtype=torch.bool))
        dataset.data = data
    return dataset