code: def test_consistency_randomstreams():
      # Verify that the random numbers generated by MRG_RandomStreams
      # are the same as the reference (Java) implementation by L'Ecuyer et al.
      seed = 12345
      n_samples = 5
      n_streams = 12
      n_substreams = 7
  
      samples = []
      rng = MRG_RandomStreams(seed=seed)
      for i in range(n_streams):
          stream_samples = []
          u = rng.uniform(size=(n_substreams,), nstreams=n_substreams)
          f = theano.function([], u)
          for j in range(n_samples):
              s = f()
              stream_samples.append(s)
          stream_samples = np.array(stream_samples)
          stream_samples = stream_samples.T.flatten()
          samples.append(stream_samples)
  
      samples = np.array(samples).flatten()
      assert np.allclose(samples, java_samples)
  
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 2 for calling a global function with example usage: test_consistency_randomstreams() without return types