code: def set_random_generator_state(state):
      """Set the `torch`, `numpy` and `random` random generator state.
  
      Args:
          state (RandomGeneratorState)
      """
      random.setstate(state.random)
      torch.random.set_rng_state(state.torch)
      np.random.set_state(state.numpy)
      if (
          state.torch_cuda is not None
          and torch.cuda.is_available()
          and len(state.torch_cuda) == torch.cuda.device_count()
      ):  # pragma: no cover
          torch.cuda.set_rng_state_all(state.torch_cuda)
  
file_path: pywick/pywick/cust_random.py
imports: from collections import namedtuple
  from contextlib import contextmanager
  import functools
  import random
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: set_random_generator_state(state) without return types