code: def assert_true_mean_in_interval_by_dkwm(
      samples,
      low,
      high,
      expected_low,
      expected_high,
      false_fail_rate=1e-6,
      name=None,
  ):
      """Asserts the mean of the given distribution is in the given interval.
  
      More precisely, fails if there is enough evidence (using the
      [Dvoretzky-Kiefer-Wolfowitz-Massart inequality]
      (https://en.wikipedia.org/wiki/CDF-based_nonparametric_confidence_interval))
      that the mean of the distribution from which the given samples are
      drawn is _outside_ the given interval with statistical significance
      `false_fail_rate` or stronger, otherwise passes.  If you also want
      to check that you are gathering enough evidence that a pass is not
      spurious, see `min_num_samples_for_dkwm_mean_test` and
      `min_discrepancy_of_true_means_detectable_by_dkwm`.
  
      Note that `false_fail_rate` is a total false failure rate for all
      the assertions in the batch.  As such, if the batch is nontrivial,
      the assertion will insist on stronger evidence to fail any one member.
  
      Args:
        samples: Floating-point `Tensor` of samples from the distribution(s)
          of interest.  Entries are assumed IID across the 0th dimension.
          The other dimensions must broadcast with `low` and `high`.
          The support is bounded: `low <= samples <= high`.
        low: Floating-point `Tensor` of lower bounds on the distributions'
          supports.
        high: Floating-point `Tensor` of upper bounds on the distributions'
          supports.
        expected_low: Floating-point `Tensor` of lower bounds on the
          expected true means.
        expected_high: Floating-point `Tensor` of upper bounds on the
          expected true means.
        false_fail_rate: *Scalar* floating-point `Tensor` admissible total
          rate of mistakes.
        name: A name for this operation (optional).
  
      Returns:
        check: Op that raises `InvalidArgumentError` if any expected mean
          interval does not overlap with the corresponding confidence
          interval.
      """
      args_list = [
          samples,
          low,
          high,
          expected_low,
          expected_high,
          false_fail_rate,
      ]
      with tf.name_scope(
          name or "assert_true_mean_in_interval_by_dkwm"
      ):
          dtype = dtype_util.common_dtype(args_list, tf.float32)
          samples = tf.convert_to_tensor(
              value=samples, name="samples", dtype=dtype
          )
          low = tf.convert_to_tensor(value=low, name="low", dtype=dtype)
          high = tf.convert_to_tensor(
              value=high, name="high", dtype=dtype
          )
          expected_low = tf.convert_to_tensor(
              value=expected_low, name="expected_low", dtype=dtype
          )
          expected_high = tf.convert_to_tensor(
              value=expected_high, name="expected_high", dtype=dtype
          )
          false_fail_rate = tf.convert_to_tensor(
              value=false_fail_rate, name="false_fail_rate", dtype=dtype
          )
          samples = _check_shape_dominates(
              samples, [low, high, expected_low, expected_high]
          )
          min_mean, max_mean = true_mean_confidence_interval_by_dkwm(
              samples, low, high, false_fail_rate
          )
          # Assert that the interval [min_mean, max_mean] intersects the
          # interval [expected_low, expected_high].  This is true if
          #   max_mean >= expected_low and min_mean <= expected_high.
          # By DeMorgan's law, that's also equivalent to
          #   not (max_mean < expected_low or min_mean > expected_high),
          # which is a way of saying the two intervals are not disjoint.
          check_confidence_interval_can_intersect = (
              tf.debugging.assert_greater_equal(
                  max_mean,
                  expected_low,
                  message="Confidence interval does not "
                  "intersect: true mean smaller than expected",
              )
          )
          with tf.control_dependencies(
              [check_confidence_interval_can_intersect]
          ):
              return tf.debugging.assert_less_equal(
                  min_mean,
                  expected_high,
                  message="Confidence interval does not "
                  "intersect: true mean greater than expected",
              )
  
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 22 for calling a global function with example usage: assert_true_mean_in_interval_by_dkwm(samples, low, high, expected_low, expected_high, false_fail_rate, name) and returns: tf