code: def test_n_samples_1():
      p = tensor.fmatrix()
      u = tensor.fvector()
      n = tensor.iscalar()
      m = multinomial.MultinomialFromUniform("auto")(p, u, n)
  
      f = function([p, u, n], m, allow_input_downcast=True)
  
      np.random.seed(12345)
      for i in [1, 5, 10, 100, 1000, 10000]:
          uni = np.random.rand(2 * i).astype(config.floatX)
          res = f([[1.0, 0.0], [0.0, 1.0]], uni, i)
          utt.assert_allclose(res, [[i * 1.0, 0.0], [0.0, i * 1.0]])
  
file_path: Theano/theano/sandbox/tests/test_multinomial.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import sys
  from six import reraise
  from nose.plugins.skip import SkipTest
  import numpy
  import theano
  from theano import config, function, tensor
  from theano.sandbox import multinomial
  import theano.tests.unittest_tools
  from theano.compat import PY3
  from theano.misc.pkl_utils import CompatUnpickler
label_desc: Use image node_id 1 for calling a global function with example usage: test_n_samples_1() without return types