code: def binomial(
      random_state,
      size=None,
      n=1,
      p=0.5,
      ndim=None,
      dtype="int64",
      prob=None,
  ):
      """
      Sample n times with probability of success prob for each trial,
      return the number of successes.
  
      If the size argument is ambiguous on the number of dimensions, ndim
      may be a plain integer to supplement the missing information.
  
      If size is None, the output shape will be determined by the shapes
      of n and prob.
  
      """
      if prob is not None:
          p = prob
          print(
              "DEPRECATION WARNING: the parameter prob to the binomal fct have been renamed to p to have the same name as np.",
              file=sys.stderr,
          )
      n = tensor.as_tensor_variable(n)
      p = tensor.as_tensor_variable(p)
      ndim, size, bcast = _infer_ndim_bcast(ndim, size, n, p)
      if n.dtype == "int64":
          try:
              np.random.binomial(
                  n=np.asarray([2, 3, 4], dtype="int64"),
                  p=np.asarray([0.1, 0.2, 0.3], dtype="float64"),
              )
          except TypeError:
              # THIS WORKS AROUND A NUMPY BUG on 32bit machine
              n = tensor.cast(n, "int32")
      op = RandomFunction(
          "binomial",
          tensor.TensorType(dtype=dtype, broadcastable=(False,) * ndim),
      )
      return op(random_state, size, n, p)
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  from copy import copy
  import numpy
  from six import string_types
  from six.moves import reduce, xrange
  import theano
  from theano import tensor
  from theano.tensor import opt
  from theano import gof
  from theano.compile import optdb
label_desc: Use image node_id 5 for calling a global function with example usage: binomial(random_state, size, n, p, ndim, dtype, prob) and returns: op