class_docstr: Module component with similar interface to numpy.random
  (numpy.random.RandomState).
  
  Parameters
  ----------
  seed : int or list of 6 int
      A default seed to initialize the random state.
      If a single int is given, it will be replicated 6 times.
      The first 3 values of the seed must all be less than M1 = 2147483647,
      and not all 0; and the last 3 values must all be less than
      M2 = 2147462579, and not all 0.
docstr: Sample `n` (`n` needs to be >= 1, default 1) times from a multinomial
  distribution defined by probabilities pvals.
  
  Example : pvals = [[.98, .01, .01], [.01, .49, .50]] and n=1 will
  probably result in [[1,0,0],[0,0,1]]. When setting n=2, this
  will probably result in [[2,0,0],[0,1,1]].
  
  Notes
  -----
  -`size` and `ndim` are only there keep the same signature as other
  uniform, binomial, normal, etc.
  TODO : adapt multinomial to take that into account
  
  -Does not do any value checking on pvals, i.e. there is no
  check that the elements are non-negative, less than 1, or
  sum to 1. passing pvals = [[-2., 2.]] will result in
  sampling [[0, 0]]
docstr_tok: ["Sample","`","n","`","(","`","n","`","needs","to","be",">","=","1",",","default","1",")","times","from","a","multinomial","distribution","defined","by","probabilities","pvals",".","Example",":","pvals","=","[","[",".98",",",".01",",",".01","]",",","[",".01",",",".49",",",".50","]","]","and","n=1","will","probably","result","in","[","[","1,0,0","]",",","[","0,0,1","]","]",".","When","setting","n=2",",","this","will","probably","result","in","[","[","2,0,0","]",",","[","0,1,1","]","]",".","Notes","--","--","-","-","`","size","`","and","`","ndim","`","are","only","there","keep","the","same","signature","as","other","uniform",",","binomial",",","normal",",","etc",".","TODO",":","adapt","multinomial","to","take","that","into","account","-Does","not","do","any","value","checking","on","pvals",",","i.e",".","there","is","no","check","that","the","elements","are","non-negative",",","less","than","1",",","or","sum","to","1.","passing","pvals","=","[","[","-2.",",","2",".","]","]","will","result","in","sampling","[","[","0",",","0","]","]"]
code: def multinomial(
      self,
      size=None,
      n=1,
      pvals=None,
      ndim=None,
      dtype="int64",
      nstreams=None,
      **kwargs,
  ):
      # TODO : need description for parameter and return
      """
      Sample `n` (`n` needs to be >= 1, default 1) times from a multinomial
      distribution defined by probabilities pvals.
  
      Example : pvals = [[.98, .01, .01], [.01, .49, .50]] and n=1 will
      probably result in [[1,0,0],[0,0,1]]. When setting n=2, this
      will probably result in [[2,0,0],[0,1,1]].
  
      Notes
      -----
      -`size` and `ndim` are only there keep the same signature as other
      uniform, binomial, normal, etc.
      TODO : adapt multinomial to take that into account
  
      -Does not do any value checking on pvals, i.e. there is no
      check that the elements are non-negative, less than 1, or
      sum to 1. passing pvals = [[-2., 2.]] will result in
      sampling [[0, 0]]
  
      """
      if pvals is None:
          raise TypeError("You have to specify pvals")
      pvals = as_tensor_variable(pvals)
      pvals = undefined_grad(pvals)
      if size is not None:
          if any(
              [isinstance(i, integer_types) and i <= 0 for i in size]
          ):
              raise ValueError(
                  "The specified size contains a dimension with value <= 0",
                  size,
              )
  
      if size is not None:
          raise ValueError(
              "Provided a size argument to MRG_RandomStreams.multinomial, "
              "which does not use the size argument."
          )
      if ndim is not None:
          raise ValueError(
              "Provided an ndim argument to MRG_RandomStreams.multinomial, "
              "which does not use the ndim argument."
          )
      if pvals.ndim == 2:
          size = pvals[:, 0].shape * n
          unis = self.uniform(
              size=size, ndim=1, nstreams=nstreams, **kwargs
          )
          op = multinomial.MultinomialFromUniform(dtype)
          n_samples = as_tensor_variable(n)
          return op(pvals, unis, n_samples)
      else:
          raise NotImplementedError(
              (
                  "MRG_RandomStreams.multinomial only"
                  " implemented for pvals.ndim = 2"
              )
          )
  
imports: from __future__ import absolute_import, print_function, division
  import warnings
  import numpy
  from six import integer_types, string_types
  from six.moves import xrange
  import theano
  from theano import Op, Apply, shared, config, Variable
  from theano import gradient, function
  from theano.gradient import undefined_grad
  from theano import tensor
  from theano.tensor import TensorType, as_tensor_variable, get_vector_length, cast, opt, scal
  from theano.compile import optdb
  from theano.gof import local_optimizer, ParamsType
  from theano.scalar import bool, int32
  from .None import multinomial
label_desc: Use image node_id 11 for calling the MRG_RandomStreams obj's underlying member method code with example usage: obj.multinomial(size, n, pvals, ndim, dtype, nstreams) and returns: op