code: def min_num_samples_for_dkwm_mean_test(
      discrepancy,
      low,
      high,
      false_fail_rate=1e-6,
      false_pass_rate=1e-6,
      name=None,
  ):
      """Returns how many samples suffice for a one-sample DKWM mean test.
  
      To wit, returns an upper bound on the number of samples necessary to
      guarantee detecting a mean difference of at least the given
      `discrepancy`, with the given `false_fail_rate` and `false_pass_rate`,
      using the [Dvoretzky-Kiefer-Wolfowitz-Massart inequality]
      (https://en.wikipedia.org/wiki/CDF-based_nonparametric_confidence_interval)
      on a scalar distribution supported on `[low, high]`.
  
      Args:
        discrepancy: Floating-point `Tensor` of desired upper limits on mean
          differences that may go undetected with probability higher than
          `1 - false_pass_rate`.
        low: `Tensor` of lower bounds on the distributions' support.
        high: `Tensor` of upper bounds on the distributions' support.
        false_fail_rate: *Scalar* floating-point `Tensor` admissible total
          rate of false failures.
        false_pass_rate: *Scalar* floating-point `Tensor` admissible rate
          of false passes.
        name: A name for this operation (optional).
  
      Returns:
        n: `Tensor` of numbers of samples to be drawn from the distributions
          of interest.
  
      The `discrepancy`, `low`, and `high` tensors must have
      broadcast-compatible shapes.
  
      For each batch member `i`, of `K` total, drawing `n[i]` samples from
      some scalar distribution supported on `[low[i], high[i]]` is enough
      to detect a difference in means of size `discrepancy[i]` or more.
      Specifically, we guarantee that (a) if the true mean is the expected
      mean (resp. in the expected interval), then `assert_true_mean_equal_by_dkwm`
      (resp. `assert_true_mean_in_interval_by_dkwm`) will fail with
      probability at most `false_fail_rate / K` (which amounts to
      `false_fail_rate` if applied to the whole batch at once), and (b) if
      the true mean differs from the expected mean (resp. falls outside
      the expected interval) by at least `discrepancy[i]`,
      `assert_true_mean_equal_by_dkwm`
      (resp. `assert_true_mean_in_interval_by_dkwm`) will pass with
      probability at most `false_pass_rate`.
  
      The required number of samples scales
      as `O((high[i] - low[i])**2)`, `O(-log(false_fail_rate/K))`,
      `O(-log(false_pass_rate))`, and `O(1 / discrepancy[i]**2)`.
      """
      with tf.name_scope(name or "min_num_samples_for_dkwm_mean_test"):
          dtype = dtype_util.common_dtype(
              [
                  low,
                  high,
                  false_fail_rate,
                  false_pass_rate,
                  discrepancy,
              ],
              tf.float32,
          )
          discrepancy = tf.convert_to_tensor(
              value=discrepancy, name="discrepancy", dtype=dtype
          )
          low = tf.convert_to_tensor(value=low, name="low", dtype=dtype)
          high = tf.convert_to_tensor(
              value=high, name="high", dtype=dtype
          )
          false_fail_rate = tf.convert_to_tensor(
              value=false_fail_rate, name="false_fail_rate", dtype=dtype
          )
          false_pass_rate = tf.convert_to_tensor(
              value=false_pass_rate, name="false_pass_rate", dtype=dtype
          )
          cdf_discrepancy = discrepancy / (high - low)
          return min_num_samples_for_dkwm_cdf_test(
              cdf_discrepancy, false_fail_rate, false_pass_rate
          )
  
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 21 for calling a global function with example usage: min_num_samples_for_dkwm_mean_test(discrepancy, low, high, false_fail_rate, false_pass_rate, name) and returns: min_num_samples_for_dkwm_cdf_test