code: def multinomial(n, pvals, size=None, **kwargs):
      num_samples = ivy.prod(size)
      assert not ivy.exists(size) or (len(size) > 0 and len(size) < 3)
      batch_size = 1
      if ivy.exists(size):
          if len(size) == 2:
              batch_size = size[0]
              num_samples = size[1]
          else:
              num_samples = size[0]
      else:
          num_samples = len(pvals)
      return ivy.multinomial(
          n, num_samples, batch_size=batch_size, probs=pvals, **kwargs
      )
  
file_path: ivy/ivy/functional/frontends/mxnet/numpy/random.py
imports: import ivy
  from ivy.functional.frontends.mxnet.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 4 for calling a global function with example usage: multinomial(n, pvals, size) and returns: ivy