code: def test_select_distinct(self):
      # Tests that multinomial_wo_replacement always selects distinct elements
  
      th_rng = RandomStreams(12345)
  
      p = tensor.fmatrix()
      n = tensor.iscalar()
      m = th_rng.multinomial_wo_replacement(pvals=p, n=n)
  
      f = function([p, n], m, allow_input_downcast=True)
  
      n_elements = 1000
      all_indices = range(n_elements)
      np.random.seed(12345)
      for i in [5, 10, 50, 100, 500, n_elements]:
          pvals = np.random.randint(1, 100, (1, n_elements)).astype(
              config.floatX
          )
          pvals /= pvals.sum(1)
          res = f(pvals, i)
          res = np.squeeze(res)
          assert len(res) == i
          assert np.all(np.in1d(np.unique(res), all_indices)), res
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import unittest
  import theano
  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 theano.tests.unittest_tools
  from .config import mode_with_gpu
  from ..multinomial import GPUAMultinomialFromUniform, GPUAChoiceFromUniform
label_desc: Use image node_id 1 for calling the test_function_wor obj's underlying member method code with example usage: obj.test_select_distinct() without return types