code: def enable_full_determinism(seed: int):
      """
      Helper function for reproducible behavior during distributed training. See
      - https://pytorch.org/docs/stable/notes/randomness.html for pytorch
      - https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism for tensorflow
      """
      # set seed first
      set_seed(seed)
  
      if is_torch_available():
          #  Enable PyTorch deterministic mode. This potentially requires either the environment
          #  variable 'CUDA_LAUNCH_BLOCKING' or 'CUBLAS_WORKSPACE_CONFIG' to be set,
          # depending on the CUDA version, so we set them both here
          os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
          os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":16:8"
          torch.use_deterministic_algorithms(True)
  
          # Enable CUDNN deterministic mode
          torch.backends.cudnn.deterministic = True
          torch.backends.cudnn.benchmark = False
  
      if is_tf_available():
          tf.config.experimental.enable_op_determinism()
  
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 2 for calling a global function with example usage: enable_full_determinism(seed) without return types