code: def get_dataset(name, sparse=True, cleaned=False):
      path = osp.join(
          osp.dirname(osp.realpath(__file__)), "..", "data", name
      )
      dataset = TUDataset(path, name, cleaned=cleaned)
      dataset.data.edge_attr = None
  
      if dataset.data.x is None:
          max_degree = 0
          degs = []
          for data in dataset:
              degs += [degree(data.edge_index[0], dtype=torch.long)]
              max_degree = max(max_degree, degs[-1].max().item())
  
          if max_degree < 1000:
              dataset.transform = T.OneHotDegree(max_degree)
          else:
              deg = torch.cat(degs, dim=0).to(torch.float)
              mean, std = deg.mean().item(), deg.std().item()
              dataset.transform = NormalizedDegree(mean, std)
  
      if not sparse:
          num_nodes = max_num_nodes = 0
          for data in dataset:
              num_nodes += data.num_nodes
              max_num_nodes = max(data.num_nodes, max_num_nodes)
  
          # Filter out a few really large graphs in order to apply DiffPool.
          if name == "REDDIT-BINARY":
              num_nodes = min(
                  int(num_nodes / len(dataset) * 1.5), max_num_nodes
              )
          else:
              num_nodes = min(
                  int(num_nodes / len(dataset) * 5), max_num_nodes
              )
  
          indices = []
          for i, data in enumerate(dataset):
              if data.num_nodes <= num_nodes:
                  indices.append(i)
          dataset = dataset.copy(torch.tensor(indices))
  
          if dataset.transform is None:
              dataset.transform = T.ToDense(num_nodes)
          else:
              dataset.transform = T.Compose(
                  [dataset.transform, T.ToDense(num_nodes)]
              )
  
      return dataset
  
file_path: pytorch_geometric/benchmark/kernel/datasets.py
imports: import os.path
  import torch
  import torch_geometric.transforms
  from torch_geometric.datasets import TUDataset
  from torch_geometric.utils import degree
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataset(name, sparse, cleaned) and returns: dataset