code: def manual_seed(
      seed: Optional[int] = None,
  ) -> Generator[None, None, None]:
      r"""Contextmanager for manual setting the torch.random seed.
  
      Args:
          seed: The seed to set the random number generator to.
  
      Returns:
          Generator
  
      Example:
          >>> with manual_seed(1234):
          >>>     X = torch.rand(3)
      """
      old_state = torch.random.get_rng_state()
      try:
          if seed is not None:
              torch.random.manual_seed(seed)
          yield
      finally:
          if seed is not None:
              torch.random.set_rng_state(old_state)
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from typing import Any, Generator, Iterable, List, Optional, Tuple, TYPE_CHECKING
  import numpy
  import scipy
  import torch
  from botorch.exceptions.errors import BotorchError
  from botorch.sampling.qmc import NormalQMCEngine
  from botorch.utils.transforms import unnormalize
  from scipy.spatial import Delaunay, HalfspaceIntersection
  from torch import LongTensor, Tensor
  from torch.quasirandom import SobolEngine
label_desc: Use image node_id 1 for calling a global function with example usage: manual_seed(seed) without return types