code: def min_num_samples_for_dkwm_cdf_two_sample_test(
      discrepancy, false_fail_rate=1e-6, false_pass_rate=1e-6, name=None
  ):
      """Returns how many samples suffice for a two-sample DKWM CDF test.
  
      Args:
        discrepancy: Floating-point `Tensor` of desired upper limits on K-S
          distances that may go undetected with probability higher than
          `1 - false_pass_rate`.
        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 and `n2[i]` samples from scalar distribution B is enough to
      detect a K-S distance of CDFs of size `discrepancy[i]` or more.  Specifically,
      we guarantee that (a) if the true CDFs are equal, then
      `assert_true_cdf_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 the true CDFs differ from each other least
      `discrepancy[i]`, `assert_true_cdf_equal_by_dkwm_two_sample` will pass with
      probability at most `false_pass_rate`.
  
      The required number of samples scales as
  
      - `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_cdf_two_sample_test"
      ):
          dtype = dtype_util.common_dtype(
              [discrepancy, false_fail_rate, false_pass_rate],
              tf.float32,
          )
          discrepancy = tf.convert_to_tensor(
              value=discrepancy, name="discrepancy", 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
          )
          n = min_num_samples_for_dkwm_cdf_test(
              discrepancy / 2.0,
              false_fail_rate / 2.0,
              false_pass_rate / 2.0,
          )
          return n, n
  
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 12 for calling a global function with example usage: min_num_samples_for_dkwm_cdf_two_sample_test(discrepancy, false_fail_rate, false_pass_rate, name) and returns: n,  n