code: def distributions(
      draw,
      dist_name=None,
      batch_shape=None,
      event_dim=None,
      enable_vars=False,
      depth=None,
      eligibility_filter=lambda name: True,
      validate_args=True,
  ):
      """Strategy for drawing arbitrary Distributions.
  
      This may draw compound distributions (i.e., `Independent`,
      `MixtureSameFamily`, and/or `TransformedDistribution`), in which case the
      underlying distributions are drawn recursively from this strategy as well.
  
      Args:
        draw: Hypothesis strategy sampler supplied by `@hps.composite`.
        dist_name: Optional Python `str`.  If given, the produced distributions
          will all have this type.
        batch_shape: An optional `TensorShape`.  The batch shape of the resulting
          Distribution.  Hypothesis will pick a batch shape if omitted.
        event_dim: Optional Python int giving the size of each of the
          distribution's parameters' event dimensions.  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(b/181859346): 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`}
        depth: Python `int` giving maximum nesting depth of compound Distributions.
          If `None`, Hypothesis will bias choose one, with a bias towards shallow
          nests.
        eligibility_filter: Optional Python callable.  Blocks some Distribution
          class names so they will not be drawn.
        validate_args: Python `bool`; whether to enable runtime assertions.
  
      Returns:
        dists: A strategy for drawing Distributions with the specified `batch_shape`
          (or an arbitrary one if omitted).
  
      Raises:
        ValueError: If it doesn't know how to instantiate a Distribution of class
          `dist_name`.
      """
      if depth is None:
          depth = draw(depths())
  
      if dist_name is None and depth > 0:
          bases = hps.just(None)
          candidates = [
              "BatchBroadcast",
              "BatchReshape",
              "Independent",
              "MixtureSameFamily",
              "TransformedDistribution",
          ]
          names = [
              name for name in candidates if eligibility_filter(name)
          ]
          compounds = hps.one_of(map(hps.just, names))
          dist_name = draw(hps.one_of([bases, compounds]))
  
      if (
          dist_name is None
          or dist_name in INSTANTIABLE_BASE_DISTS
          or dist_name == "Empirical"
      ):
          return draw(
              base_distributions(
                  dist_name,
                  batch_shape=batch_shape,
                  event_dim=event_dim,
                  enable_vars=enable_vars,
                  eligibility_filter=eligibility_filter,
                  validate_args=validate_args,
              )
          )
      if dist_name == "BatchBroadcast":
          return draw(
              batch_broadcasts(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "BatchReshape":
          return draw(
              batch_reshapes(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "Independent":
          return draw(
              independents(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "Sample":
          return draw(
              samples(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "Masked":
          return draw(
              masked_distributions(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "MixtureSameFamily":
          return draw(
              mixtures_same_family(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "Mixture":
          return draw(
              mixtures(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "TransformedDistribution":
          return draw(
              transformed_distributions(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  depth,
                  eligibility_filter,
                  validate_args,
              )
          )
      if dist_name == "QuantizedDistribution":
          return draw(
              quantized_distributions(
                  batch_shape,
                  event_dim,
                  enable_vars,
                  eligibility_filter,
                  validate_args,
              )
          )
      raise ValueError("Unknown Distribution name {}".format(dist_name))
  
imports: import collections
  import functools
  import inspect
  from absl import logging
  import hypothesis
  from hypothesis import strategies
  import numpy
  import six
  import tensorflow.compat.v2
  from tensorflow_probability.python import distributions
  from tensorflow_probability.python import util
  from tensorflow_probability.python.bijectors import ascending
  from tensorflow_probability.python.bijectors import hypothesis_testlib
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.experimental import distributions
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 36 for calling a global function with example usage: distributions(draw, dist_name, batch_shape, event_dim, enable_vars, depth, eligibility_filter, validate_args) and returns: draw, draw, draw, draw, draw, draw, draw, draw, draw, draw