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 objects.
      >>> rng = np.random.RandomState(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: from __future__ import absolute_import, print_function, division
  from copy import copy, deepcopy
  from functools import wraps
  import logging
  import sys
  import unittest
  from parameterized import parameterized
  from nose.tools import assert_raises
  from six import integer_types
  from six.moves import StringIO
  import numpy
  import theano
  import theano.tensor
  from theano import config
label_desc: Use image node_id 2 for calling a global function with example usage: fetch_seed(pseed) and returns: seed