code: def create_dataloaders(
      graph, data_mode, part, num_workers, config, load_epoch
  ):
      """Create train loader and eval loader for different datasets.
  
      **Notes**:
          For extremely large dataset like ogbn-papers100m, we will add a new example in near future,
          since current eval_loader might not be suitable for large dataset.
  
      """
      final_epochs = config.epochs
      # Give a PartitionDataset usage.
      # train_dataset = PartitionDataset(graph, part)
      # collate_fn = partial(
      #     subdata_batch_fn,
      #     graph=graph,
      #     part=part,
      #     node_buffer=np.zeros(
      #         graph.num_nodes, dtype="int64"))
  
      if config.gen_train_data_in_advance:
          new_load_epoch = 1
      else:
          num_batches = config.num_parts / config.batch_size
          if num_batches > load_epoch:
              # No need to use load_epoch inputs.
              new_load_epoch = 1
          else:
              new_load_epoch = (
                  config.epochs
                  if config.epochs < load_epoch
                  else load_epoch
              )
  
      train_dataset = PrePartitionDataset(
          graph, part, load_epoch=new_load_epoch
      )
      collate_fn = partial(
          presubdata_batch_fn,
          graph=graph,
          part=part,
          node_buffer=np.zeros(graph.num_nodes, dtype="int64"),
      )
      final_epochs = int(
          math.ceil(config.epochs / new_load_epoch)
      )  # Maybe larger than origin.
  
      train_loader = Dataloader(
          train_dataset,
          batch_size=config.batch_size,
          drop_last=False,
          shuffle=True,
          num_workers=num_workers,
          collate_fn=collate_fn,
      )
  
      if config.gen_train_data_in_advance:
          # For relatively small dataset, we can generate train data in advance.
          train_loader = list(train_loader)
  
      eval_dataset = EvalPartitionDataset(
          graph,
          part,
          config.batch_size,
          node_buffer=np.zeros(graph.num_nodes, dtype="int64"),
      )
      eval_loader = eval_dataset.dataloader_list
  
      return train_loader, eval_loader, final_epochs
  
imports: import os
  import math
  from functools import partial
  import numpy
  import paddle
  import pgl
  from pgl.utils.logger import log
  from pgl.utils.data import Dataset
  from pgl.sampling.custom import subgraph
  from pgl.utils.data.dataloader import Dataloader
  from pgl.utils.transform import to_undirected, add_self_loops
  from utils import generate_mask
label_desc: Use image node_id 5 for calling a global function with example usage: create_dataloaders(graph, data_mode, part, num_workers, config, load_epoch) and returns: train_loader,  eval_loader,  final_epochs