code: def set_seed(seed: int):
      """
      Helper function for reproducible behavior to set the seed in `random`, `numpy`, `torch` and/or `tf` (if installed).
  
      Args:
          seed (`int`): The seed to set.
      """
      random.seed(seed)
      np.random.seed(seed)
      if is_torch_available():
          torch.manual_seed(seed)
          torch.cuda.manual_seed_all(seed)
          # ^^ safe to call this function even if cuda is not available
      if is_tf_available():
          tf.random.set_seed(seed)
  
imports: import copy
  import functools
  import gc
  import inspect
  import os
  import random
  import re
  import threading
  import time
  from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
  import numpy
  from .utils import ExplicitEnum, is_psutil_available, is_tf_available, is_torch_available, is_torch_cuda_available, is_torch_tpu_available, requires_backends
label_desc: Use image node_id 3 for calling a global function with example usage: set_seed(seed) without return types