code: def init_seed(given_seed, n_gpu, verbose=True):
      """Initializes random seeds for sources of randomness. If seed is -1, randomly select seed.
  
      Sets the random seed for sources of randomness (numpy, torch and python random). If seed is
      specified as -1, the seed will be randomly selected and used to initialize all random seeds.
      The value used to initialize the random seeds is returned.
  
      Args:
          given_seed (int): random seed.
          n_gpu (int): number of GPUs.
          verbose: whether to print random seed.
  
      Returns:
          int: value used to initialize random seeds.
  
      """
      used_seed = get_seed(given_seed)
      random.seed(used_seed)
      np.random.seed(used_seed)
      torch.manual_seed(used_seed)
      if verbose:
          print("Using seed: {}".format(used_seed))
  
      if n_gpu > 0:
          # noinspection PyUnresolvedReferences
          torch.cuda.manual_seed_all(used_seed)
  
      # MAKE SURE THIS IS SET
      return used_seed
  
imports: import json
  import numpy
  import os
  import random
  import time
  import torch
  from dataclasses import dataclass
  from typing import Any
  import jiant.utils.python.io
  import jiant.utils.zlog
label_desc: Use image node_id 4 for calling a global function with example usage: init_seed(given_seed, n_gpu, verbose) and returns: used_seed