code: def test_broadcastable():
      R = MRG_RandomStreams(234)
      x = tensor.matrix()
      size1 = (10, 1)
      size2 = (x.shape[0], 1)
      pvals_1 = np.random.uniform(0, 1, size=size1)
      pvals_1 = pvals_1 / sum(pvals_1)
      pvals_2 = R.uniform(size=size2)
      pvals_2 = pvals_2 / tensor.sum(pvals_2)
  
      for distribution in [
          R.uniform,
          R.normal,
          R.truncated_normal,
          R.binomial,
          R.multinomial,
          R.multinomial_wo_replacement,
      ]:
          # multinomial or multinomial_wo_replacement does not support "size" argument,
          # the sizes of them are implicitly defined with "pvals" argument.
          if distribution in [
              R.multinomial,
              R.multinomial_wo_replacement,
          ]:
              # check when all dimensions are constant
              uu = distribution(pvals=pvals_1)
              assert uu.broadcastable == (False, True)
  
              # check when some dimensions are theano variables
              uu = distribution(pvals=pvals_2)
              assert uu.broadcastable == (False, True)
          else:
              # check when all dimensions are constant
              uu = distribution(size=size1)
              assert uu.broadcastable == (False, True)
  
              # check when some dimensions are theano variables
              uu = distribution(size=size2)
              assert uu.broadcastable == (False, True)
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import sys
  import time
  import unittest
  from nose.tools import assert_raises
  import numpy
  from six.moves import xrange
  import theano
  from theano import change_flags, config, tensor
  from theano.sandbox import rng_mrg
  from theano.sandbox.rng_mrg import MRG_RandomStreams
  from theano.tests import unittest_tools
  from theano.tests.unittest_tools import attr
label_desc: Use image node_id 8 for calling a global function with example usage: test_broadcastable() without return types