code: def test_binomial():
      # TODO: test size=None, ndim=X
      # TODO: test size=X, ndim!=X.ndim
      # TODO: test random seed in legal value(!=0 and other)
      # TODO: test sample_size not a multiple of guessed #streams
      # TODO: test size=Var, with shape that change from call to call
      # we test size in a tuple of int and a tensor.shape.
      # we test the param p with int.
  
      if (
          config.mode in ["DEBUG_MODE", "DebugMode", "FAST_COMPILE"]
          or config.mode == "Mode"
          and config.linker in ["py"]
      ):
          sample_size = (10, 50)
          steps = 50
          rtol = 0.02
      else:
          sample_size = (500, 50)
          steps = int(1e3)
          rtol = 0.01
  
      x = tensor.matrix()
      for mean in [0.1, 0.5]:
          for size, const_size, var_input, input in [
              (sample_size, sample_size, [], []),
              (
                  x.shape,
                  sample_size,
                  [x],
                  [np.zeros(sample_size, dtype=config.floatX)],
              ),
              # test empty size (scalar)
              ((), (), [], []),
          ]:
              yield (
                  t_binomial,
                  mean,
                  size,
                  const_size,
                  var_input,
                  input,
                  steps,
                  rtol,
              )
  
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 9 for calling a global function with example usage: test_binomial() without return types