code: def fetch_seed(pseed=None):
      """
      Returns the seed to use for running the unit tests.
      If an explicit seed is given, it will be used for seeding numpy's rng.
      If not, it will use config.unittest.rseed (its default value is 666).
      If config.unittest.rseed is set to "random", it will seed the rng with
      None, which is equivalent to seeding with a random seed.
  
      Useful for seeding RandomState or Generator objects.
      >>> rng = np.random.RandomState(unittest_tools.fetch_seed())
      >>> rng = np.random.default_rng(unittest_tools.fetch_seed())
      """
  
      seed = pseed or config.unittests__rseed
      if seed == "random":
          seed = None
  
      try:
          if seed:
              seed = int(seed)
          else:
              seed = None
      except ValueError:
          print(
              (
                  "Error: config.unittests__rseed contains "
                  "invalid seed, using None instead"
              ),
              file=sys.stderr,
          )
          seed = None
  
      return seed
  
imports: import logging
  import sys
  from copy import copy, deepcopy
  from functools import wraps
  import numpy
  import pytest
  import pytensor
  from pytensor.compile.debugmode import str_diagnostic
  from pytensor.configdefaults import config
  from pytensor.gradient import verify_grad
  from pytensor.tensor.basic import as_tensor_variable
  from pytensor.tensor.math import _allclose
  from pytensor.tensor.math import add
label_desc: Use image node_id 1 for calling a global function with example usage: fetch_seed(pseed) and returns: seed