code: def _check_shape_dominates(samples, parameters):
      """Check that broadcasting `samples` against `parameters` does not expand it.
  
      Why?  To be very sure that the samples tensor is not accidentally enlarged by
      broadcasting against tensors that are supposed to be describing the
      distribution(s) sampled from, lest the sample counts end up inflated.
  
      Args:
        samples: A `Tensor` whose shape is to be protected against broadcasting.
        parameters: A list of `Tensor`s who are parameters for the statistical test.
  
      Returns:
        samples: Return original `samples` with control dependencies attached
          to ensure no broadcasting.
      """
  
      def check(t):
          samples_batch_shape = tf.shape(samples)[1:]
          broadcasted_batch_shape = tf.broadcast_dynamic_shape(
              samples_batch_shape, tf.shape(t)
          )
          # This rank check ensures that I don't get a wrong answer from the
          # _shapes_ broadcasting against each other.
          samples_batch_ndims = tf.size(samples_batch_shape)
          ge = tf.debugging.assert_greater_equal(
              samples_batch_ndims, tf.rank(t)
          )
          eq = tf.debugging.assert_equal(
              samples_batch_shape, broadcasted_batch_shape
          )
          return ge, eq
  
      checks = list(itertools.chain(*[check(t) for t in parameters]))
      with tf.control_dependencies(checks):
          return tf.identity(samples)
  
imports: import functools
  import itertools
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.seed_stream import SeedStream
label_desc: Use image node_id 16 for calling a global function with example usage: _check_shape_dominates(samples, parameters) and returns: ge,  eq, tf