code: def _pval_cvm_2samp_exact(s, nx, ny):
      """
      Compute the exact p-value of the Cramer-von Mises two-sample test
      for a given value s (float) of the test statistic by enumerating
      all possible combinations. nx and ny are the sizes of the samples.
      """
      rangex = np.arange(nx)
      rangey = np.arange(ny)
  
      us = []
  
      # x and y are all possible partitions of ranks from 0 to nx + ny - 1
      # into two sets of length nx and ny
      # Here, ranks are from 0 to nx + ny - 1 instead of 1 to nx + ny, but
      # this does not change the value of the statistic.
      for x, y in _all_partitions(nx, ny):
          # compute the statistic
          u = nx * np.sum((x - rangex) ** 2)
          u += ny * np.sum((y - rangey) ** 2)
          us.append(u)
  
      # compute the values of u and the frequencies
      u, cnt = np.unique(us, return_counts=True)
      return np.sum(cnt[u >= s]) / np.sum(cnt)
  
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 20 for calling a global function with example usage: _pval_cvm_2samp_exact(s, nx, ny) and returns: unknown