code: def testVonMisesSampleKsTest(self):
      concentrations_v = np.logspace(-3, 3, 50)
      # We are fixing the location to zero. The reason is that for loc != 0,
      # scipy's von Mises distribution CDF becomes shifted, so it's no longer
      # in [0, 1], but is in something like [-0.3, 0.7]. This breaks kstest.
      dist = von_mises.VonMises(
          self.make_tensor(0.0),
          self.make_tensor(concentrations_v),
          validate_args=True,
      )
      n = 10000
      sample_values = self.evaluate(
          dist.sample(n, seed=test_util.test_seed())
      )
      self.assertEqual(sample_values.shape, (n, 50))
  
      fails = 0
      trials = 0
      for concentrationi, concentration in enumerate(concentrations_v):
          s = sample_values[:, concentrationi]
          trials += 1
          p = sp_stats.kstest(s, sp_stats.vonmises(concentration).cdf)[
              1
          ]
          if p <= 0.05:
              fails += 1
      self.assertLess(fails, trials * 0.1)
  
imports: import numpy
  from scipy import special
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import von_mises
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 21 for calling the _VonMisesTest obj's underlying member method code with example usage: obj.testVonMisesSampleKsTest() without return types