code: def test_rvs_broadcast(dist, shape_args):
      if dist in ["gausshyper", "genexpon"]:
          pytest.skip("too slow")
  
      # If shape_only is True, it means the _rvs method of the
      # distribution uses more than one random number to generate a random
      # variate.  That means the result of using rvs with broadcasting or
      # with a nontrivial size will not necessarily be the same as using the
      # numpy.vectorize'd version of rvs(), so we can only compare the shapes
      # of the results, not the values.
      # Whether or not a distribution is in the following list is an
      # implementation detail of the distribution, not a requirement.  If
      # the implementation the rvs() method of a distribution changes, this
      # test might also have to be changed.
      shape_only = dist in [
          "betaprime",
          "dgamma",
          "exponnorm",
          "norminvgauss",
          "nct",
          "dweibull",
          "rice",
          "levy_stable",
          "skewnorm",
      ]
  
      distfunc = getattr(stats, dist)
      loc = np.zeros(2)
      scale = np.ones((3, 1))
      nargs = distfunc.numargs
      allargs = []
      bshape = [3, 2]
      # Generate shape parameter arguments...
      for k in range(nargs):
          shp = (k + 4,) + (1,) * (k + 2)
          allargs.append(shape_args[k] * np.ones(shp))
          bshape.insert(0, k + 4)
      allargs.extend([loc, scale])
      # bshape holds the expected shape when loc, scale, and the shape
      # parameters are all broadcast together.
  
      check_rvs_broadcast(
          distfunc, dist, allargs, bshape, shape_only, "d"
      )
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import numpy.testing
  import pytest
  from pytest import raises
  from scipy._lib._numpy_compat import suppress_warnings
  from scipy.integrate import IntegrationWarning
  from scipy import stats
  from scipy.special import betainc
  from .common_tests import check_normalization, check_moment, check_mean_expect, check_var_expect, check_skew_expect, check_kurt_expect, check_entropy, check_private_entropy, check_entropy_vect_scale, check_edge_support, check_named_args, check_random_state_property, check_meth_dtype, check_ppf_dtype, check_cmplx_deriv, check_pickling, check_rvs_broadcast
  from scipy.stats._distr_params import distcont
label_desc: Use image node_id 6 for calling a global function with example usage: test_rvs_broadcast(dist, shape_args) without return types