code: def _cdf_cvm_inf(x):
      """
      Calculate the cdf of the Cramér-von Mises statistic (infinite sample size).
  
      See equation 1.2 in Csorgo, S. and Faraway, J. (1996).
  
      Implementation based on MAPLE code of Julian Faraway and R code of the
      function pCvM in the package goftest (v1.1.1), permission granted
      by Adrian Baddeley. Main difference in the implementation: the code
      here keeps adding terms of the series until the terms are small enough.
  
      The function is not expected to be accurate for large values of x, say
      x > 4, when the cdf is very close to 1.
      """
      x = np.asarray(x)
  
      def term(x, k):
          # this expression can be found in [2], second line of (1.3)
          u = np.exp(gammaln(k + 0.5) - gammaln(k + 1)) / (
              np.pi**1.5 * np.sqrt(x)
          )
          y = 4 * k + 1
          q = y**2 / (16 * x)
          b = kv(0.25, q)
          return u * np.sqrt(y) * np.exp(-q) * b
  
      tot = np.zeros_like(x, dtype="float")
      cond = np.ones_like(x, dtype="bool")
      k = 0
      while np.any(cond):
          z = term(x[cond], k)
          tot[cond] = tot[cond] + z
          cond[cond] = np.abs(z) >= 1e-7
          k += 1
  
      return tot
  
imports: from collections import namedtuple
  from dataclasses import make_dataclass
  import numpy
  import warnings
  from itertools import combinations
  import scipy.stats
  from scipy.optimize import shgo
  from .None import distributions
  from ._continuous_distns import chi2, norm
  from scipy.special import gamma, kv, gammaln
  from .None import _wilcoxon_data
label_desc: Use image node_id 3 for calling a global function with example usage: _cdf_cvm_inf(x) and returns: tot, unknown