Repository: scipy/scipy
File: scipy/stats/_morestats.py (Python)

Code before:
                   pi, exp, ravel, count_nonzero)

from scipy import optimize, special, interpolate, stats
from scipy._lib._bunch import _make_tuple_bunch
from scipy._lib._util import _rename_parameter, _contains_nan, _get_nan
from scipy._lib.deprecation import _NoValue
import scipy._lib.array_api_extra as xpx

from scipy._lib._array_api import (
    array_namespace,
    is_marray,
    xp_capabilities,
    is_numpy,
    is_jax,
    is_dask,
    xp_size,
    xp_vector_norm,
    xp_promote,
    xp_result_type,
    xp_device,
    xp_ravel,
    _length_nonmasked,
)

from ._ansari_swilk_statistics import gscale
from . import _stats_py, _wilcoxon
from ._fit import FitResult
from ._stats_py import (_get_pvalue, SignificanceResult,  # noqa:F401
                        _SimpleNormal, _SimpleChi2, _SimpleF, _demean)
from .contingency import chi2_contingency
from . import distributions
from ._distn_infrastructure import rv_generic
from ._axis_nan_policy import _axis_nan_policy_factory, _broadcast_arrays


__all__ = ['mvsdist',
           'bayes_mvs', 'kstat', 'kstatvar', 'probplot', 'ppcc_max', 'ppcc_plot',
           'boxcox_llf', 'boxcox', 'boxcox_normmax', 'boxcox_normplot',
           'shapiro', 'anderson', 'ansari', 'bartlett', 'levene',
           'fligner', 'mood', 'wilcoxon', 'median_test',
           'circmean', 'circvar', 'circstd', 'anderson_ksamp',
           'yeojohnson_llf', 'yeojohnson', 'yeojohnson_normmax',
           'yeojohnson_normplot', 'directional_stats',
           'false_discovery_control'
           ]


Mean = namedtuple('Mean', ('statistic', 'minmax'))
Variance = namedtuple('Variance', ('statistic', 'minmax'))
Std_dev = namedtuple('Std_dev', ('statistic', 'minmax'))


Review comment (suggestion):
We can remove all the `swilk` code from `_ansari_swilk_statistics`, or we can leave it and continue to test against it (`test_against_as181`).

Code after:
                   pi, exp, ravel, count_nonzero)

from scipy import optimize, special, interpolate, stats
from scipy._lib._bunch import _make_tuple_bunch
from scipy._lib._util import _rename_parameter, _contains_nan, _get_nan
from scipy._lib.deprecation import _NoValue
import scipy._external.array_api_extra as xpx

from scipy._lib._array_api import (
    array_namespace,
    is_marray,
    xp_capabilities,
    is_numpy,
    is_jax,
    is_dask,
    xp_size,
    xp_vector_norm,
    xp_promote,
    xp_result_type,
    xp_device,
    xp_ravel,
    _length_nonmasked,
    is_lazy_array,
)

from ._ansari_swilk_statistics import gscale
from . import _stats_py, _wilcoxon
from ._fit import FitResult
from ._stats_py import (_get_pvalue, SignificanceResult,  # noqa:F401
                        _SimpleNormal, _SimpleChi2, _SimpleF, _demean)
from .contingency import chi2_contingency
from . import distributions
from ._distn_infrastructure import rv_generic
from ._axis_nan_policy import _axis_nan_policy_factory, _broadcast_arrays


__all__ = ['mvsdist',
           'bayes_mvs', 'kstat', 'kstatvar', 'probplot', 'ppcc_max', 'ppcc_plot',
           'boxcox_llf', 'boxcox', 'boxcox_normmax', 'boxcox_normplot',
           'shapiro', 'anderson', 'ansari', 'bartlett', 'levene',
           'fligner', 'mood', 'wilcoxon', 'median_test',
           'circmean', 'circvar', 'circstd', 'anderson_ksamp',
           'yeojohnson_llf', 'yeojohnson', 'yeojohnson_normmax',
           'yeojohnson_normplot', 'directional_stats',
           'false_discovery_control'
           ]


Mean = namedtuple('Mean', ('statistic', 'minmax'))
Variance = namedtuple('Variance', ('statistic', 'minmax'))
Std_dev = namedtuple('Std_dev', ('statistic', 'minmax'))