code: def min_num_samples_for_dkwm_mean_two_sample_test(
      discrepancy,
      low1,
      high1,
      low2,
      high2,
      false_fail_rate=1e-6,
      false_pass_rate=1e-6,
      name=None,
  ):
      """Returns how many samples suffice for a two-sample DKWM mean test.
  
      DKWM is the [Dvoretzky-Kiefer-Wolfowitz-Massart inequality]
      (https://en.wikipedia.org/wiki/CDF-based_nonparametric_confidence_interval).
  
      Args:
        discrepancy: Floating-point `Tensor` of desired upper limits on mean
          differences that may go undetected with probability higher than
          `1 - false_pass_rate`.
        low1: Floating-point `Tensor` of lower bounds on the supports of the
          distributions A.
        high1: Floating-point `Tensor` of upper bounds on the supports of
          the distributions A.
        low2: Floating-point `Tensor` of lower bounds on the supports of the
          distributions B.
        high2: Floating-point `Tensor` of upper bounds on the supports of
          the distributions B.
        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:
        n1: `Tensor` of numbers of samples to be drawn from the distributions A.
        n2: `Tensor` of numbers of samples to be drawn from the distributions B.
  
      For each batch member `i`, of `K` total, drawing `n1[i]` samples
      from scalar distribution A supported on `[low1[i], high1[i]]` and `n2[i]`
      samples from scalar distribution B supported on `[low2[i], high2[i]]`
      is enough to detect a difference in their true means of size
      `discr[i]` or more.  Specifically, we guarantee that (a) if their
      true means are equal, `assert_true_mean_equal_by_dkwm_two_sample`
      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 their true means differ by at least `discr[i]`,
      `assert_true_mean_equal_by_dkwm_two_sample` will pass with
      probability at most `false_pass_rate`.
  
      The required number of samples scales as
  
      - `O((high1[i] - low1[i])**2)`, `O((high2[i] - low2[i])**2)`,
      - `O(-log(false_fail_rate/K))`,
      - `O(-log(false_pass_rate))`, and
      - `O(1 / discrepancy[i]**2)`.
      """
      args_list = [
          low1,
          high1,
          low2,
          high2,
          false_fail_rate,
          false_pass_rate,
          discrepancy,
      ]
      with tf.name_scope(
          name or "min_num_samples_for_dkwm_mean_two_sample_test"
      ):
          dtype = dtype_util.common_dtype(args_list, tf.float32)
          discrepancy = tf.convert_to_tensor(
              value=discrepancy, name="discrepancy", dtype=dtype
          )
          low1 = tf.convert_to_tensor(
              value=low1, name="low1", dtype=dtype
          )
          high1 = tf.convert_to_tensor(
              value=high1, name="high1", dtype=dtype
          )
          low2 = tf.convert_to_tensor(
              value=low2, name="low2", dtype=dtype
          )
          high2 = tf.convert_to_tensor(
              value=high2, name="high2", 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
          )
          # Could choose to cleverly allocate discrepancy tolerances and
          # failure probabilities, but this is sound.
          n1 = min_num_samples_for_dkwm_mean_test(
              discrepancy / 2.0,
              low1,
              high1,
              false_fail_rate / 2.0,
              false_pass_rate / 2.0,
          )
          n2 = min_num_samples_for_dkwm_mean_test(
              discrepancy / 2.0,
              low2,
              high2,
              false_fail_rate / 2.0,
              false_pass_rate / 2.0,
          )
          return n1, n2
  
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 25 for calling a global function with example usage: min_num_samples_for_dkwm_mean_two_sample_test(discrepancy, low1, high1, low2, high2, false_fail_rate, false_pass_rate, name) and returns: n1,  n2