code: def test_fail_select_alot(self):
      # Tests that ChoiceFromUniform fails when asked to sample more
      # elements than the actual number of elements
  
      p = tensor.fmatrix()
      u = tensor.fvector()
      n = tensor.iscalar()
      m = multinomial.ChoiceFromUniform(odtype="auto")(p, u, n)
  
      f = function([p, u, n], m, allow_input_downcast=True)
  
      n_elements = 100
      n_selected = 200
      np.random.seed(12345)
      uni = np.random.rand(n_selected).astype(config.floatX)
      pvals = np.random.randint(1, 100, (1, n_elements)).astype(
          config.floatX
      )
      pvals /= pvals.sum(1)
      self.assertRaises(ValueError, f, pvals, uni, n_selected)
  
file_path: Theano/theano/sandbox/tests/test_multinomial_wo_replacement.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import os
  from theano import config, function, tensor
  from theano.compat import PY3
  from theano.misc.pkl_utils import CompatUnpickler
  from theano.sandbox import multinomial
  from theano.sandbox.rng_mrg import MRG_RandomStreams
  import unittest
label_desc: Use image node_id 2 for calling the test_OP obj's underlying member method code with example usage: obj.test_fail_select_alot() without return types