code: def set_random_seeds(seed, use_deterministic_cudnn):
      import random
  
      import numpy as np
      import torch
      from pytext.utils import cuda
  
      # See https://pytorch.org/docs/stable/notes/randomness.html
      random.seed(seed)
      np.random.seed(seed)
      torch.manual_seed(seed)
      if cuda.CUDA_ENABLED and use_deterministic_cudnn:
          print(
              """WARNING: Your training might be slower because you have set
          use_deterministic_cudnn flag to True. Read
          https://pytorch.org/docs/stable/notes/randomness.html and
          https://discuss.pytorch.org/t/what-is-the-differenc-between-cudnn-deterministic-and-cudnn-benchmark/38054
          """
          )
          torch.backends.cudnn.deterministic = True
          torch.backends.cudnn.benchmark = False
  
imports: from collections.abc import Sequence
label_desc: Use image node_id 2 for calling a global function with example usage: set_random_seeds(seed, use_deterministic_cudnn) without return types