code: def set_random_seed(seed, deterministic=False):
      """Set random seed.
      Args:
          seed (int): Seed to be used.
          deterministic (bool): Whether to set the deterministic option for
              CUDNN backend, i.e., set `torch.backends.cudnn.deterministic`
              to True and `torch.backends.cudnn.benchmark` to False.
              Default: False.
  
      # Speed-reproducibility tradeoff https://pytorch.org/docs/stable/notes/randomness.html
      if cuda_deterministic:  # slower, more reproducible
          cudnn.deterministic = True
          cudnn.benchmark = False
      else:  # faster, less reproducible
          cudnn.deterministic = False
          cudnn.benchmark = True
  
      """
      random.seed(seed)
      np.random.seed(seed)
      torch.manual_seed(seed)
      torch.cuda.manual_seed_all(seed)
      if deterministic:
          torch.backends.cudnn.deterministic = True
          torch.backends.cudnn.benchmark = False
  
imports: import numpy
  import matplotlib.pyplot
  from mpl_toolkits.mplot3d import Axes3D
  import random
  import torch
  import torch.nn
  import torch.nn.functional
  import os
  from collections import abc
label_desc: Use image node_id 6 for calling a global function with example usage: set_random_seed(seed, deterministic) without return types