code: def worker_init_fn(worker_id, num_workers, rank, seed):
      # The seed of each worker equals to
      # num_worker * rank + worker_id + user_seed
      worker_seed = num_workers * rank + worker_id + seed
      np.random.seed(worker_seed)
      random.seed(worker_seed)
      torch.manual_seed(worker_seed)
  
file_path: insightface/recognition/arcface_torch/utils/utils_distributed_sampler.py
imports: import math
  import os
  import random
  import numpy
  import torch
  import torch.distributed
  from torch.utils.data import DistributedSampler
label_desc: Use image node_id 2 for calling a global function with example usage: worker_init_fn(worker_id, num_workers, rank, seed) without return types