code: def make_reproducible(seed: int):
      """Makes the random operations within a block of code reproducible for a given seed."""
      # First: Get the starting random state, and restore it after.
      start_random_state = random.getstate()
      start_np_rng_state = np.random.get_state()
      with torch.random.fork_rng():
          # Set the random state, using the given seed.
          random.seed(seed)
          np_seed = random.randint(0, 2**32 - 1)
          np.random.seed(np_seed)
  
          torch_seed = random.randint(0, 2**32 - 1)
          torch.random.manual_seed(torch_seed)
          if torch.cuda.is_available():
              torch.cuda.manual_seed_all(torch_seed)
  
          yield
  
      # Restore the random state to the original state.
      np.random.set_state(start_np_rng_state)
      random.setstate(start_random_state)
  
imports: import os
  import random
  import warnings
  from abc import ABC
  from contextlib import contextmanager
  from dataclasses import asdict
  from logging import getLogger
  from pathlib import Path
  from typing import Any, ClassVar, Dict, List, Optional, Type, Union
  import numpy
  from orion.algo.space import Space
  from orion.benchmark.task.base import BenchmarkTask
  from orion.benchmark.task.profet.model_utils import MetaModelConfig
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.utils import compute_identity
  from orion.core.utils.flatten import flatten
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.worker import transformer
label_desc: Use image node_id 1 for calling a global function with example usage: make_reproducible(seed) without return types