code: def get_loader(dataset, sampler, batch_size, shuffle=True):
      if sampler == "full_batch" or len(dataset) > 1:
          loader_train = DataLoader(
              dataset,
              batch_size=batch_size,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "neighbor":
          loader_train = NeighborSampler(
              dataset[0],
              sizes=cfg.train.neighbor_sizes[: cfg.gnn.layers_mp],
              batch_size=batch_size,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "random_node":
          loader_train = RandomNodeSampler(
              dataset[0],
              num_parts=cfg.train.train_parts,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "saint_rw":
          loader_train = GraphSAINTRandomWalkSampler(
              dataset[0],
              batch_size=batch_size,
              walk_length=cfg.train.walk_length,
              num_steps=cfg.train.iter_per_epoch,
              sample_coverage=0,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "saint_node":
          loader_train = GraphSAINTNodeSampler(
              dataset[0],
              batch_size=batch_size,
              num_steps=cfg.train.iter_per_epoch,
              sample_coverage=0,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "saint_edge":
          loader_train = GraphSAINTEdgeSampler(
              dataset[0],
              batch_size=batch_size,
              num_steps=cfg.train.iter_per_epoch,
              sample_coverage=0,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
      elif sampler == "cluster":
          loader_train = ClusterLoader(
              dataset[0],
              num_parts=cfg.train.train_parts,
              save_dir="{}/{}".format(
                  cfg.dataset.dir, cfg.dataset.name.replace("-", "_")
              ),
              batch_size=batch_size,
              shuffle=shuffle,
              num_workers=cfg.num_workers,
              pin_memory=True,
          )
  
      else:
          raise NotImplementedError(
              "%s sampler is not implemented!" % sampler
          )
      return loader_train
  
file_path: GraphGym/graphgym/loader_pyg.py
imports: from typing import Callable
  import torch
  import torch_geometric.transforms
  from torch_geometric.datasets import PPI, Amazon, Coauthor, KarateClub, MNISTSuperpixels, Planetoid, QM7b, TUDataset
  from torch_geometric.loader import ClusterLoader, DataLoader, GraphSAINTEdgeSampler, GraphSAINTNodeSampler, GraphSAINTRandomWalkSampler, NeighborSampler, RandomNodeSampler
  from torch_geometric.utils import index_to_mask, negative_sampling, to_undirected
  import graphgym.register
  from graphgym.config import cfg
  from graphgym.models.transform import create_link_label, neg_sampling_transform
label_desc: Use image node_id 8 for calling a global function with example usage: get_loader(dataset, sampler, batch_size, shuffle) and returns: loader_train