code: def set_dataloader_seeds(_worker_id: int):
      """
      See: https://tanelp.github.io/posts/a-bug-that-plagues-thousands-of-open-source-ml-projects/
      When using "Fork" process spawning, the dataloader workers inherit the seeds of the
      parent process for numpy. While torch seeds are handled correctly across dataloaders and
      across epochs, numpy seeds are not. Therefore in order to ensure each worker has a
      different and deterministic seed, we must explicitly set the numpy seed to the torch seed.
      Also see https://pytorch.org/docs/stable/data.html#randomness-in-multi-process-data-loading
      """
      # numpy and random seed must be between 0 and 2 ** 32 - 1.
      torch_seed = torch.utils.data.get_worker_info().seed % (2**32)
      random.seed(torch_seed)
      np.random.seed(torch_seed)
  
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 10 for calling a global function with example usage: set_dataloader_seeds(_worker_id) without return types