code: def min_discrepancy_of_true_cdfs_detectable_by_dkwm(
      n, false_fail_rate, false_pass_rate, name=None
  ):
      """Returns the minimum CDF discrepancy that a DKWM-based test can detect.
  
      DKWM is the [Dvoretzky-Kiefer-Wolfowitz-Massart inequality]
      (https://en.wikipedia.org/wiki/CDF-based_nonparametric_confidence_interval).
  
      Note that `false_fail_rate` is a total false failure rate for all
      the tests in the batch.  As such, if the batch is nontrivial, each
      member will demand more samples.  The `false_pass_rate` is also
      interpreted as a total, but is treated asymmetrically: If each test
      in the batch detects its corresponding discrepancy with probability
      at least `1 - false_pass_rate`, then running all those tests and
      failing if any one fails will jointly detect all those discrepancies
      with the same `false_pass_rate`.
  
      Args:
        n: `Tensor` of numbers of samples to be drawn from the distributions
          of interest.
        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:
        discr: `Tensor` of lower bounds on the K-S distances between true
           CDFs detectable by a DKWM-based test.
  
      For each batch member `i`, of `K` total, drawing `n[i]` samples from some
      scalar distribution is enough to detect a K-S distance in CDFs of size
      `discr[i]` or more.  Specifically, we guarantee that (a) if the true CDF is
      the expected CDF, then `assert_true_cdf_equal_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 CDF differs from
      the expected CDF by at least `discr[i]`, `assert_true_cdf_equal_by_dkwm` will
      pass with probability at most `false_pass_rate`.
  
      The detectable discrepancy scales as
  
      - `O(1 / sqrt(n[i]))`,
      - `O(-log(false_fail_rate/K))`, and
      - `O(-log(false_pass_rate))`.
      """
      with tf.name_scope(
          name or "min_discrepancy_of_true_cdfs_detectable_by_dkwm"
      ):
          dtype = dtype_util.common_dtype(
              [n, false_fail_rate, false_pass_rate], tf.float32
          )
          n = tf.convert_to_tensor(value=n, name="n", 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
          )
          # Algorithm: Assume a true CDF F.  The DKWM inequality gives a
          # stochastic bound on how far the observed empirical CDF F_n can be.
          # Then, using the DKWM inequality again gives a stochastic bound on
          # the farthest candidate true CDF F' that
          # true_mean_confidence_interval_by_dkwm might consider.  At worst, these
          # errors may go in the same direction, so the distance between F and
          # F' is bounded by the sum.
          # On batching: false fail rates sum, so I need to reduce
          # the input to account for the batching.  False pass rates
          # max, so I don't.
          sampling_envelope = _dkwm_cdf_envelope(n, false_pass_rate)
          itemwise_false_fail_rate = _itemwise_error_rate(
              total_rate=false_fail_rate, param_tensors=[n]
          )
          analysis_envelope = _dkwm_cdf_envelope(
              n, itemwise_false_fail_rate
          )
          return sampling_envelope + analysis_envelope
  
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 2 for calling a global function with example usage: min_discrepancy_of_true_cdfs_detectable_by_dkwm(n, false_fail_rate, false_pass_rate, name) and returns: unknown