code: def _check_ks(
      self, significance_level, cupy_len, numpy_len, *args, **kwargs
  ):
      assert "size" in kwargs
  
      # cupy
      func = self._get_generator_func(*args, **kwargs)
      vals_cupy = func()
      assert vals_cupy.size > 0
      count = 1 + (cupy_len - 1) // vals_cupy.size
      vals_cupy = [vals_cupy]
      for _ in range(1, count):
          vals_cupy.append(func())
      vals_cupy = cupy.stack(vals_cupy).ravel()
  
      # numpy
      kwargs["size"] = numpy_len
      dtype = kwargs.pop("dtype", None)
      numpy_rng = self.get_rng(numpy, self.__seed)
      vals_numpy = getattr(numpy_rng, self.target_method)(
          *args, **kwargs
      )
      if dtype is not None:
          vals_numpy = vals_numpy.astype(dtype, copy=False)
  
      # test
      d_plus, d_minus, p_value = two_sample_Kolmogorov_Smirnov_test(
          cupy.asnumpy(vals_cupy), vals_numpy
      )
      if p_value < significance_level:
          message = """Rejected null hypothesis:
  p: %f
  D+ (cupy < numpy): %f
  D- (cupy > numpy): %f""" % (
              p_value,
              d_plus,
              d_minus,
          )
          raise AssertionError(message)
  
imports: import functools
  import unittest
  import numpy
  import cupy
  from cupy import testing
  from cupy.testing import _condition
label_desc: Use image node_id 9 for calling the BaseGeneratorTestCase obj's underlying member method code with example usage: obj._check_ks(significance_level, cupy_len, numpy_len) without return types