code: def validateKolmogorovSmirnov(
      self,
      shape,
      mean,
      stddev,
      minval,
      maxval,
      use_stateless=False,
      seed=1618,
  ):
      try:
          import scipy.stats  # pylint: disable=g-import-not-at-top
  
          random_seed.set_random_seed(seed)
          with self.cached_session():
              if use_stateless:
                  new_seed = random_ops.random_uniform(
                      [2],
                      seed=seed,
                      minval=0,
                      maxval=(2**31 - 1),
                      dtype=np.int32,
                  )
                  samples = stateless.stateless_parameterized_truncated_normal(
                      shape, new_seed, mean, stddev, minval, maxval
                  ).eval()
              else:
                  samples = random_ops.parameterized_truncated_normal(
                      shape, mean, stddev, minval, maxval
                  ).eval()
  
          assert (~np.isnan(samples)).all()
          minval = max(mean - stddev * 10, minval)
          maxval = min(mean + stddev * 10, maxval)
          dist = scipy.stats.norm(loc=mean, scale=stddev)
          cdf_min = dist.cdf(minval)
          cdf_max = dist.cdf(maxval)
  
          def truncated_cdf(x):
              return np.clip(
                  (dist.cdf(x) - cdf_min) / (cdf_max - cdf_min),
                  0.0,
                  1.0,
              )
  
          pvalue = scipy.stats.kstest(samples, truncated_cdf)[1]
          self.assertGreater(pvalue, 1e-10)
      except ImportError as e:
          tf_logging.warn(
              "Cannot test truncated normal op: %s" % str(e)
          )
  
imports: import functools
  import math
  import timeit
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 2 for calling the ParameterizedTruncatedNormalTest obj's underlying member method code with example usage: obj.validateKolmogorovSmirnov(shape, mean, stddev, minval, maxval, use_stateless, seed) and returns: np