code: def test_ndim(self):
      # Test that the behaviour of 'ndim' optional parameter
      # 'ndim' is an optional integer parameter, specifying the length
      # of the 'shape', passed as a keyword argument.
  
      # ndim not specified, OK
      random = RandomStreams(utt.fetch_seed())
      fn = function([], random.uniform((2, 2)))
  
      # ndim specified, consistent with shape, OK
      random2 = RandomStreams(utt.fetch_seed())
      fn2 = function([], random2.uniform((2, 2), ndim=2))
  
      val1 = fn()
      val2 = fn2()
      assert np.all(val1 == val2)
  
      # ndim specified, inconsistent with shape, should raise ValueError
      random3 = RandomStreams(utt.fetch_seed())
      self.assertRaises(ValueError, random3.uniform, (2, 2), ndim=1)
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  import unittest
  import numpy
  from theano.tensor import raw_random
  from theano.tensor.shared_randomstreams import RandomStreams
  from theano import function, shared
  from theano import tensor
  from theano import compile, config, gof
  from theano.tests import unittest_tools
label_desc: Use image node_id 7 for calling the T_SharedRandomStreams obj's underlying member method code with example usage: obj.test_ndim() without return types