code: def pyg_num_workers(world_size):
      num_workers = None
      if hasattr(os, "sched_getaffinity"):
          try:
              num_workers = len(os.sched_getaffinity(0)) / (
                  2 * world_size
              )
          except Exception:
              pass
      if num_workers is None:
          num_workers = os.cpu_count() / (2 * world_size)
      return int(num_workers)
  
imports: from trainers import Trainer
  from trainers import extend_tensor
  from datasets import OGBNPapers100MDataset
  from models.pyg import GraphSAGE
  import torch
  import numpy
  import torch.distributed
  from torch.nn.parallel import DistributedDataParallel
  import torch.nn.functional
  from torch_geometric.utils.sparse import index2ptr
  from torch_geometric.data import HeteroData
  from torch_geometric.loader import NeighborLoader
  import gc
  import os
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: pyg_num_workers(world_size) and returns: int