code: def broadcasting_params(
      draw,
      batch_shape,
      params_event_ndims,
      event_dim=None,
      enable_vars=False,
      constraint_fn_for=lambda param: identity_fn,
      mutex_params=(),
      param_strategy_fn=None,
      dtype=np.float32,
  ):
      """Streategy for drawing parameters which jointly have the given batch shape.
  
      Specifically, the batch shapes of the returned parameters will broadcast to
      the requested batch shape.
  
      The dtypes of the returned parameters are determined by their respective
      constraint functions.
  
      Args:
        draw: Hypothesis strategy sampler supplied by `@hps.composite`.
        batch_shape: A `TensorShape`.  The returned parameters' batch shapes will
          broadcast to this.
        params_event_ndims: Python `dict` mapping the name of each parameter to a
          Python `int` giving the event ndims for that parameter.
        event_dim: Optional Python int giving the size of each parameter's event
          dimensions (except where overridden by any applicable constraint
          functions).  This is shared across all parameters, permitting square event
          matrices, compatible location and scale Tensors, etc. If omitted,
          Hypothesis will choose one.
        enable_vars: TODO(bjp): Make this `True` all the time and put variable
          initialization in slicing_test. If `False`, the returned parameters are
          all `tf.Tensor`s and not {`tf.Variable`, `tfp.util.DeferredTensor`
          `tfp.util.TransformedVariable`}.
        constraint_fn_for: Python callable mapping parameter name to constraint
          function.  The latter is itself a Python callable which converts an
          unconstrained Tensor (currently with float32 values from -200 to +200)
          into one that meets the parameter's validity constraints.
        mutex_params: Python iterable of Python sets.  Each set gives a clique of
          mutually exclusive parameters (e.g., the 'probs' and 'logits' of a
          Categorical).  At most one parameter from each set will appear in the
          result.
        param_strategy_fn: Optional callable with signature
          `strategy = param_strategy_fn(shape, dtype, constraint_fn)`. If provided,
          overrides the default strategy for generating float-valued parameters.
          Default value: `constrained_tensors`.
        dtype: Dtype for generated parameters.
  
      Returns:
        params: A Hypothesis strategy for drawing Python `dict`s mapping parameter
          name to a `tf.Tensor`, `tf.Variable`, `tfp.util.DeferredTensor`, or
          `tfp.util.TransformedVariable`.  The batch shapes of the returned
          parameters broadcast together to the supplied `batch_shape`.  Only
          parameters whose names appear as keys in `params_event_ndims` will appear
          (but possibly not all of them, depending on `mutex_params`).
      """
      if event_dim is None:
          event_dim = draw(hps.integers(min_value=2, max_value=6))
      if param_strategy_fn is None:
          param_strategy_fn = constrained_tensors
  
      params_event_ndims = params_event_ndims or {}
      remaining_params = set(params_event_ndims.keys())
      params_to_use = []
      while remaining_params:
          param = draw(hps.sampled_from(sorted(remaining_params)))
          params_to_use.append(param)
          remaining_params.remove(param)
          for mutex_set in mutex_params:
              if param in mutex_set:
                  remaining_params -= mutex_set
  
      param_batch_shapes = draw(
          broadcasting_named_shapes(batch_shape, params_to_use)
      )
      params_kwargs = dict()
      for param in params_to_use:
          param_batch_shape = param_batch_shapes[param]
          param_event_rank = params_event_ndims[param]
          param_shape = (
              tensorshape_util.as_list(param_batch_shape)
              + [event_dim] * param_event_rank
          )
  
          # Reduce our risk of exceeding TF kernel broadcast limits.
          hp.assume(len(param_shape) < 6)
  
          # TODO(axch): Can I replace `params_event_ndims` and `constraint_fn_for`
          # with a map from params to `Suppport`s, and use `tensors_in_support` here?
          param_strategy = param_strategy_fn(
              constraint_fn=constraint_fn_for(param),
              shape=param_shape,
              dtype=dtype,
          )
          params_kwargs[param] = draw(
              maybe_variable(
                  param_strategy,
                  enable_vars=enable_vars,
                  dtype=dtype,
                  name=param,
              )
          )
      return params_kwargs
  
imports: import contextlib
  import os
  import re
  import traceback
  import unittest
  import hypothesis
  from hypothesis.extra import numpy
  import hypothesis.strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 22 for calling a global function with example usage: broadcasting_params(draw, batch_shape, params_event_ndims, event_dim, enable_vars, constraint_fn_for, mutex_params, param_strategy_fn, dtype) and returns: params_kwargs