code: def create_dataloader(dataset, device, is_train=True):
      # The second of two tasks in the dataset is link prediction.
      task = dataset.tasks[1]
      itemset = task.train_set if is_train else task.test_set
  
      # Sample seed edges from the itemset.
      datapipe = gb.ItemSampler(itemset, batch_size=256)
  
      # Copy the mini-batch to the designated device for sampling and training.
      datapipe = datapipe.copy_to(device)
  
      if is_train:
          # Sample negative edges for the seed edges.
          datapipe = datapipe.sample_uniform_negative(
              dataset.graph, negative_ratio=1
          )
  
          # Sample neighbors for the seed nodes.
          datapipe = datapipe.sample_neighbor(
              dataset.graph, fanouts=[4, 2]
          )
  
          # Exclude seed edges from the subgraph.
          datapipe = datapipe.transform(gb.exclude_seed_edges)
  
      else:
          # Sample neighbors for the seed nodes.
          datapipe = datapipe.sample_neighbor(
              dataset.graph, fanouts=[-1, -1]
          )
  
      # Fetch features for sampled nodes.
      datapipe = datapipe.fetch_feature(
          dataset.feature, node_feature_keys=["feat"]
      )
  
      # Initiate the dataloader for the datapipe.
      return gb.DataLoader(datapipe)
  
file_path: dgl/examples/sampling/graphbolt/quickstart/link_prediction.py
imports: import dgl.graphbolt
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn import SAGEConv
  from torcheval.metrics import BinaryAUROC
label_desc: Use image node_id 1 for calling a global function with example usage: create_dataloader(dataset, device, is_train) and returns: gb