code: def test_dkwm_cdf_one_sample_batch_discrete_assertion(self, dtype):
      rng = np.random.RandomState(seed=0)
      num_samples = 13000
      batch_shape = [3, 2]
      shape = [num_samples] + batch_shape
  
      probs = [0.1, 0.2, 0.3, 0.4]
      samples = rng.choice(4, size=shape, p=probs).astype(dtype=dtype)
  
      def cdf(x):
          answer = tf.where(x < 3.0, dtype(0.6), dtype(1.0))
          answer = tf.where(x < 2.0, dtype(0.3), answer)
          answer = tf.where(x < 1.0, dtype(0.1), answer)
          return tf.where(x < 0.0, dtype(0.0), answer)
  
      def left_continuous_cdf(x):
          answer = tf.where(x <= 3.0, dtype(0.6), dtype(1.0))
          answer = tf.where(x <= 2.0, dtype(0.3), answer)
          answer = tf.where(x <= 1.0, dtype(0.1), answer)
          return tf.where(x <= 0.0, dtype(0.0), answer)
  
      self.evaluate(
          st.assert_true_cdf_equal_by_dkwm(
              samples,
              cdf,
              left_continuous_cdf=left_continuous_cdf,
              false_fail_rate=1e-6,
          )
      )
      d = st.min_discrepancy_of_true_cdfs_detectable_by_dkwm(
          tf.ones(batch_shape) * num_samples,
          false_fail_rate=1e-6,
          false_pass_rate=1e-6,
      )
      self.assertTrue(np.all(self.evaluate(d) < 0.05))
  
      def check_catches_mistake(wrong_probs):
          wrong_samples = rng.choice(
              len(wrong_probs), size=shape, p=wrong_probs
          ).astype(dtype=dtype)
          with self.assertRaisesOpError(
              "Empirical CDF outside K-S envelope"
          ):
              self.evaluate(
                  st.assert_true_cdf_equal_by_dkwm(
                      wrong_samples,
                      cdf,
                      left_continuous_cdf=left_continuous_cdf,
                      false_fail_rate=1e-6,
                  )
              )
  
      check_catches_mistake([0.1, 0.2, 0.3, 0.3, 0.1])
      check_catches_mistake([0.2, 0.2, 0.3, 0.3])
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 6 for calling the StatisticalTestingTest obj's underlying member method code with example usage: obj.test_dkwm_cdf_one_sample_batch_discrete_assertion(dtype) and returns: tf, tf