code: def set_seeds_globally(
      seed: int, set_cudnn_determinism: bool, info_txt: str
  ) -> None:
      """Set random seeds for numpy, torch and python random number generators.
  
      :param seed: The seed to be used.
      :param set_cudnn_determinism: Specify whether to set the cudnn backend to deterministic.
      :param info_txt: Optional info text to print with the seed info.
      """
      BColors.print_colored(
          f"Setting random seed globally to: {seed} - {info_txt}",
          BColors.OKGREEN,
      )
      random.seed(seed)
      torch.random.manual_seed(seed)
      np.random.seed(seed)
  
      if set_cudnn_determinism:
          if hasattr(torch, "use_deterministic_algorithms"):
              # Pytorch version >= 1.8
              torch.use_deterministic_algorithms(True)
          elif hasattr(torch, "set_deterministic"):
              # Pytorch version < 1.8
              torch.set_deterministic(True)
          torch.backends.cudnn.deterministic = True
          torch.backends.cudnn.benchmark = False
          torch.backends.cudnn.enabled = False
  
file_path: maze/maze/core/utils/seeding.py
imports: import random
  from typing import Optional, Sequence, Any, Union, List
  import numpy
  import torch
  import torch.backends.cudnn
  from maze.core.utils.factory import ConfigType, Factory
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 1 for calling a global function with example usage: set_seeds_globally(seed, set_cudnn_determinism, info_txt) without return types