code: def set_seeds(cfg, dist_rank):
      """
      Set the python random, numpy and torch seed for each gpu. Also set the CUDA
      seeds if the CUDA is available. This ensures deterministic nature of the training.
      """
      # Since in the pytorch sampler, we increment the seed by 1 for every epoch.
      seed_value = (
          cfg.SEED_VALUE + dist_rank
      ) * cfg.OPTIMIZER.num_epochs
      logging.info(f"MACHINE SEED: {seed_value}")
      random.seed(seed_value)
      np.random.seed(seed_value)
      torch.manual_seed(seed_value)
      if (
          cfg["MACHINE"]["DEVICE"] == "gpu"
          and torch.cuda.is_available()
      ):
          torch.cuda.manual_seed_all(seed_value)
  
imports: import collections
  import collections.abc
  import logging
  import os
  import random
  import sys
  import tempfile
  import time
  from functools import partial, wraps
  from typing import Tuple
  import numpy
  import pkg_resources
  import torch
  import torch.multiprocessing
  from iopath.common.file_io import g_pathmgr
  from scipy.sparse import csr_matrix
  from vissl.utils.extract_features_utils import ExtractedFeaturesLoader
label_desc: Use image node_id 9 for calling a global function with example usage: set_seeds(cfg, dist_rank) without return types