code: def test_uniform():
      # TODO: test param low, high
      # TODO: test size=None
      # TODO: test ndim!=size.ndim
      # TODO: test bad seed
      # TODO: test size=Var, with shape that change from call to call
      if (
          config.mode in ["DEBUG_MODE", "DebugMode", "FAST_COMPILE"]
          or config.mode == "Mode"
          and config.linker in ["py"]
      ):
          sample_size = (10, 100)
          steps = 50
      else:
          sample_size = (500, 50)
          steps = int(1e3)
  
      x = tensor.matrix()
      for size, const_size, var_input, input in [
          (sample_size, sample_size, [], []),
          (
              x.shape,
              sample_size,
              [x],
              [np.zeros(sample_size, dtype=config.floatX)],
          ),
          (
              (x.shape[0], sample_size[1]),
              sample_size,
              [x],
              [np.zeros(sample_size, dtype=config.floatX)],
          ),
          # test empty size (scalar)
          ((), (), [], []),
      ]:
          # TEST CPU IMPLEMENTATION
          # The python and C implementation are tested with DebugMode
          x = tensor.matrix()
          R = MRG_RandomStreams(234)
          # Note: we specify `nstreams` to avoid a warning.
          # TODO Look for all occurrences of `guess_n_streams` and `30 * 256`
          # for such situations: it would be better to instead filter the
          # warning using the warning module.
          u = R.uniform(
              size=size,
              nstreams=rng_mrg.guess_n_streams(size, warn=False),
          )
          f = theano.function(var_input, u)
          assert any(
              [
                  isinstance(
                      node.op, theano.sandbox.rng_mrg.mrg_uniform
                  )
                  for node in f.maker.fgraph.toposort()
              ]
          )
          f(*input)
  
          # Increase the number of steps if sizes implies only a few samples
          if np.prod(const_size) < 10:
              steps_ = steps * 100
          else:
              steps_ = steps
          basictest(
              f, steps_, const_size, prefix="mrg cpu", inputs=input
          )
  
          RR = theano.tensor.shared_randomstreams.RandomStreams(234)
  
          uu = RR.uniform(size=size)
          ff = theano.function(var_input, uu)
          # It's not our problem if numpy generates 0 or 1
          basictest(
              ff,
              steps_,
              const_size,
              prefix="numpy",
              allow_01=True,
              inputs=input,
          )
  
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 7 for calling a global function with example usage: test_uniform() without return types