code: def test_gh17775_regression(x, n, sf, cdf, pdf, rtol):
      # Regression test for gh-17775. In scipy 1.9.3 and earlier,
      # these test would fail.
      #
      # KS one asymptotic sf ~ e^(-(6nx+1)^2 / 18n)
      # Given a large 32-bit integer n, 6n will overflow in the c implementation.
      # Example of broken behaviour:
      # ksone.sf(2.0e-5, 1000000000) == 0.9374359693473666
      ks = stats.ksone
      vals = np.array([ks.sf(x, n), ks.cdf(x, n), ks.pdf(x, n)])
      expected = np.array([sf, cdf, pdf])
      npt.assert_allclose(vals, expected, rtol=rtol)
      # The sf+cdf must sum to 1.0.
      npt.assert_equal(vals[0] + vals[1], 1.0)
      # Check inverting the (potentially very small) sf (uses a lower tolerance)
      npt.assert_allclose([ks.isf(sf, n)], [x], rtol=1e-8)
  
imports: import sys
  import numpy
  import numpy.testing
  import pytest
  from pytest import raises
  from scipy.integrate import IntegrationWarning
  import itertools
  from scipy import stats
  from .common_tests import check_normalization, check_moment, check_mean_expect, check_var_expect, check_skew_expect, check_kurt_expect, check_entropy, check_private_entropy, check_entropy_vect_scale, check_edge_support, check_named_args, check_random_state_property, check_meth_dtype, check_ppf_dtype, check_cmplx_deriv, check_pickling, check_rvs_broadcast, check_freezing, check_munp_expect
  from scipy.stats._distr_params import distcont
  from scipy.stats._distn_infrastructure import rv_continuous_frozen
label_desc: Use image node_id 8 for calling a global function with example usage: test_gh17775_regression(x, n, sf, cdf, pdf, rtol) without return types