code: def test_seed_fn():
      idx = tensor.ivector()
  
      for new_seed, same in [(234, True), (None, True), (23, False)]:
          random = MRG_RandomStreams(234)
          fn1 = theano.function(
              [], random.uniform((2, 2), dtype="float32")
          )
          fn2 = theano.function(
              [], random.uniform((3, 3), nstreams=2, dtype="float32")
          )
          fn3 = theano.function(
              [idx],
              random.uniform(idx, nstreams=3, ndim=1, dtype="float32"),
          )
  
          fn1_val0 = fn1()
          fn1_val1 = fn1()
          assert not np.allclose(fn1_val0, fn1_val1)
          fn2_val0 = fn2()
          fn2_val1 = fn2()
          assert not np.allclose(fn2_val0, fn2_val1)
          fn3_val0 = fn3([4])
          fn3_val1 = fn3([4])
          assert not np.allclose(fn3_val0, fn3_val1)
          assert fn1_val0.size == 4
          assert fn2_val0.size == 9
  
          random.seed(new_seed)
  
          fn1_val2 = fn1()
          fn1_val3 = fn1()
          fn2_val2 = fn2()
          fn2_val3 = fn2()
          fn3_val2 = fn3([4])
          fn3_val3 = fn3([4])
          assert np.allclose(fn1_val0, fn1_val2) == same
          assert np.allclose(fn1_val1, fn1_val3) == same
          assert np.allclose(fn2_val0, fn2_val2) == same
          assert np.allclose(fn2_val1, fn2_val3) == same
          assert np.allclose(fn3_val0, fn3_val2) == same
          assert np.allclose(fn3_val1, fn3_val3) == same
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import sys
  import time
  import unittest
  from nose.tools import assert_raises
  import numpy
  from six.moves import xrange
  import theano
  from theano import change_flags, config, tensor
  from theano.sandbox import rng_mrg
  from theano.sandbox.rng_mrg import MRG_RandomStreams
  from theano.tests import unittest_tools
  from theano.tests.unittest_tools import attr
label_desc: Use image node_id 21 for calling a global function with example usage: test_seed_fn() without return types