
    doip              
       :   S SK r S SKrS SKrS SKrS SKrS SKrS SKJr  S SKJ	r	  S SK
rS SKr S SKrSrS SKJr  S SKJrJrJrJrJrJrJrJr  S SKJr  S S	KJr  S S
KJ r    S SK!J"r"  Sr# S SK%r%Sr&S r(S r)\RT                  " SSS9S 5       r+\&(       d  \RT                  S 5       r,1 Skr-\R\                  " \S\R^                  R`                  S9/r1\2" 5       r3\2" 5       r4\(       Gai   S SK5r5\1Rm                  \R\                  " \5S\R^                  R`                  S95        \ Rn                  " \5Rp                  5      \ Rr                  " S5      :  a  \" S5      e\5Rt                  " SS9   S SK;r;\1Rm                  \R\                  " \;S\R^                  R`                  S95        \;Rx                  " \5        \S:w  a  \3R{                  S5        \R|                  " SSS9r?\?S:X  a  \;R                  " \;R                  5        O\?S:w  a  \B" S \? S!35      e  S SKCrC\1Rm                  \R\                  " \CS"\R^                  R`                  S95        \3R{                  S"5        \R                  " S#S$\ES%9  S S&KFJGrG  CG S SKHrI\1Rm                  \R\                  " \IR                  S'\R^                  R`                  \R^                  R                  /S95        \IR                  R                  S(S5        \IR                  R                  S)\IR                  " \5      S    5        \S:w  a  \3R{                  S'5        \4R{                  S'5         S SKNJOrP  \1Rm                  \R\                  " \PS*\R^                  R`                  \R^                  R                  /S95        \4R{                  S*5        \1 V s1 s H  o R                  iM     sn rR\R\--
  (       a   e\S" \\T5      (       as  \R                  " 5       S+;  a^  \2" \ R                  " \5      5      rW\WS,1:w  a?  \W\R-
  (       a  S-\R S.\W 3rX\B" \X5      e\1 Vs/ s H  nUR                  \W;   d  M  UPM     snr1\RT                  " \1S/9S0 5       rY\R^                  R                  \S1S29r[S3 r\S4\R                  S5\	S6   S7S4S8 jr^\RT                  S9 5       rM\(       a  \R                  R                  \R                  R                  \R                  " 5       S:5      5        \R                  R                  S;SSS<9  \R                  R                  S=SSSS\f" \R                  5      S>9  \R                  R                  S?S=5      rj\R                  R                  \j5        \#(       a  \SNS@ j5       rl\l\"lm        \2" / SAQ5      \"ln        \Rp                  SB:  a#  \"R                  R                  \2" / SCQ5      5        / SDQ\"lo        SESESFSGSHSI.\"lp        \2" SJ/5      \"lq        SK/ SLQ0\"lr        S\"ls        \"R                  R{                  SM5        gg! \ a    Sr GNf = f! \$ a    Sr# GNf = f! \' a    Sr& GNf = f! \ a     GNf = f! \ a     GNUf = f! \ a     GNf = f! \ a     GN>f = f! \ a     GNf = fs  sn f s  snf )O    N)contextmanager)LiteralTF)get_fpu_mode)SCIPY_ARRAY_APISCIPY_DEVICEarray_namespace
default_xpis_cupyis_daskis_jaxis_torch)FPUModeChangeWarning)patch_lazy_xp_functions)_pep440)	dt_configc                 |   U R                  SS5        U R                  SS5        U R                  SS5        U R                  SS5        U R                  SS5        U R                  SS5         SS	Kn SSKJn  [
        (       d6  U R                  SS5        U R                  SS5        U R                  SS5        [        R                  S:X  a+  [        R                  S:  a  [        R                  " SSS9  g	g	g	! [         a    U R                  SS
5         Nf = f! [         a    U R                  SS5         Nf = f)a  
Add pytest markers to avoid PytestUnknownMarkWarning

This needs to contain all markers that are SciPy-specific, as well as
dummy fallbacks for markers defined in optional test packages.

Note that we need both the registration here *and* in `pytest.ini`.
markerszslow: Tests that are very slow.zHxslow: mark test as extremely slow (not run unless explicitly requested)z8xfail_on_32bit: mark test as failing on 32-bit platformsz;array_api_backends: test iterates on all array API backendszskip_xp_backends(backends, reason=None, np_only=False, cpu_only=False, eager_only=False, exceptions=None): mark the desired skip configuration for the `skip_xp_backends` fixturezxfail_xp_backends(backends, reason=None, np_only=False, cpu_only=False, eager_only=False, exceptions=None): mark the desired xfail configuration for the `xfail_xp_backends` fixturer   Nz.timeout: mark a test for a non-default timeout)parse_durationz8fail_slow: mark a test for a non-default timeout failurezUparallel_threads_limit(n): run the given test function in parallel using `n` threads.z8thread_unsafe: mark the test function as single-threadedzCiterations(n): run the given test function `n` times in each threadposix)      
forkserverT)force)addinivalue_linepytest_timeout	Exceptionpytest_fail_slowr   PARALLEL_RUN_AVAILABLEosnamesysversion_infomultiprocessingset_start_method)configr   r   s      J/var/www/html/land-ocr/venv/lib/python3.13/site-packages/scipy/conftest.pypytest_configurer'   )   sa    I)+
IRT
IBD
IEG
I
.0 I
/1
IS 	4
 "!!	" 	F	
 	Q	

 
ww'c..8 	((TB	 93  IG	II  SQ	SSs$   .C: 3D :DDD;:D;c                    U R                  S5      nUbG   [        [        R                  R	                  SS5      5      nU(       d  [        R                  " S5        U R                  S5      nUbJ  [        R                  " S5      R                  S:  a&  [        R                  " S	UR                  S    35        [        R                  " 5          [        R                  " S
[        R                   5         SSKJn  SnU(       af   [        [        R                  S   5      n[        R*                  " S5      (       d.  [        R,                  " 5       S-  n[/        Xe-  S5      n W" USS9  S S S 5        g ! [
         a    Sn GNDf = f! [&         a    Sn Nf = f! [(         a     S S S 5        g f = f! [&         a     S S S 5        g f = f! , (       d  f       g = f)NxslowSCIPY_XSLOW0Fz@very slow test; set environment variable SCIPY_XSLOW=1 to run itxfail_on_32bitr      z&Fails on our 32-bit test platform(s): ignore)threadpool_limitsTPYTEST_XDIST_WORKER_COUNTOMP_NUM_THREADS      blas)user_api)get_closest_markerintr   environget
ValueErrorpytestskipnpintpitemsizexfailargswarningscatch_warningssimplefilter PytestUnraisableExceptionWarningthreadpoolctlr/   r   KeyErrorgetenv	cpu_countmax)itemmarkvr/   HAS_THREADPOOLCTLxdist_worker_countmax_openmp_threadsthreads_per_workers           r&   pytest_runtest_setuprR   e   s   ""7+D	BJJNN=#67A KK K L""#34DBGGAJ//!3=diil^LM 
	 	 	"h(O(OP	&7 $
 
%(4O)P%Q"
 99.//%'\\^q%8"%();)QST%U"%&86J5 
#	"  	A	$  	& %	&  ) 
#	"$ !  = 
#	"67 
#	"s   )E4 &G	6F>G	F"AG	$F14FFFG	FG	
F.#G	-F..G	1
G;G	GG		
Gfunction)scopeautousec              #      #    [        5       nSv   [        5       nX:w  a$  [        R                  " SUS SUS S3[        SS9  gg7f)z1
Check FPU mode was not changed during the test.
NzFPU mode changed from z#xz to z during the testr   )category
stacklevel)r   rB   warnr   )requestold_modenew_modes      r&   check_fpu_moder]      sQ     
 ~H	~H.xm4} M! !3	C s   AAc                      g)Nr3    r_       r&   num_parallel_threadsra      s    r`   >   cupynumpytorcharray_api_strict	jax.numpy
dask.arrayrc   )idmarksre   z2.3z'array-api-strict must be >= version 2.3z2024.12)api_versionrd   cpuSCIPY_DEFAULT_DTYPEfloat64)defaultfloat32zUSCIPY_DEFAULT_DTYPE env var, if set, can only be either 'float64' or 'float32'. Got 'z
' instead.rb   r.   z#cupyx.jit.rawkernel is experimentalrW   )signalrf   jax_enable_x64jax_default_devicerg   )1trueallrv   z!'--array-api-backend' must be in z; got )paramsc              #   T  #    [        U S5        [        U S5        U R                  n[        UR                  S5      5      n[        (       a5  [        X R                  S9   [        U5         Uv   SSS5        SSS5        gUv   g! , (       d  f       N= f! , (       d  f       g= f7f)a  Run the test that uses this fixture on each available array API library.

You can select all and only the tests that use the `xp` fixture by
passing `-m array_api_backends` to pytest.

You can select where individual tests run through the `@skip_xp_backends`,
`@xfail_xp_backends`, and `@skip_xp_invalid_arg` pytest markers.

Please read: https://docs.scipy.org/doc/scipy/dev/api-dev/array_api.html#adding-tests
r<   r@   r   rZ   xpN)skip_or_xfail_xp_backendsparamr   emptyr   r   r	   ry   s     r&   rz   rz   &  s      gv. gw/	B	!	%B %WG
 B   HG    HGs6   AB(B+B0B8B(
B	B
B%!B(zsTest involves masked arrays, object arrays, or other types that are not valid input when `SCIPY_ARRAY_API` is used.reasonc           	         [        U R                  R                  U S35      5      n[         Vs0 s H  o3/ _M     nnU GH  n[	        UR
                  5      1 Sk-
  nU(       a  [        SU 35      e[	        UR
                  R                  S/ 5      5      nU[        -
  n[        U[        -
  5      =n(       a  [        SU S[        [        5       35      eUR
                  R                  SS5      (       a^  UR
                  R                  S	5      =(       d    S
n	UR                  5        H%  u  p:US:w  d  M  X7;  d  M  U
R                  U	5        M'     OUR
                  R                  SS5      (       aH  UR
                  R                  S	5      =(       d    Sn	[        U-
   H  nXC   R                  U	5        M     OhUR
                  R                  SS5      (       aG  UR
                  R                  S	5      =(       d    Sn	[        U-
   H  nXC   R                  U	5        M     [        UR                  5      S:X  a  UR                  S   nU[        ;  a  [        SU S[        [        5       35      eUR
                  R                  S	5      =(       d    SU 3n	XC   R                  SU	5        S H"  nXR
                  ;   d  M  [        U SU 35      e   GM  [        UR                  5      S:  d  GM  [        SUR                   35      e   UR                  5        VV
s0 s H  u  p:U
(       d  M  X:S   _M     sn
n$ s  snf s  sn
nf )zlA helper for {skip,xfail}_xp_backends.

Return dict of {backend to skip/xfail: top reason to skip/xfail it}
_xp_backends>   r   np_onlycpu_only
eager_only
exceptionszInvalid kwargs: r   zUnknown backend(s): z; must be a subset of r   Fr   z"do not run with non-NumPy backendsrc   r   zTno array-agnostic implementation or delegation available for this backend and devicer   z*eager checks not executed on lazy backendsr3   r   zUnknown backend: z; must be one of z#do not run with array API backend: )r   r   r   r   z is mutually exclusive with z,Please specify only one backend per marker: )listnodeiter_markersxp_known_backendssetkwargs	TypeErrorr9   r:   itemsappendxp_skip_cpu_only_backendsxp_skip_eager_only_backendslenrA   insert)rZ   skip_or_xfailr   backendreasonsmarkerinvalid_kwargsr   invalid_exceptionsr   backend_reasonskwargs               r&   _backends_kwargs_from_requestr   P  s.   
 7<<,,l-KLMG*;<*;w{*;G<V]]+ /I I.~.>?@@**<<=
'*;;"&z4E'E"FFF34F3G H4489J4K3LN O O ==Y..]]&&x0X4XF,3MMO(g%'*C#**62 -< ]]z511]]&&x0 /.  5zA ''/ B ]]|U33]]&&x0 >< 6C ''/ D v{{q kk!nG// #4WI >3378I3J2K"M N N]]&&x0 A5gY?  ##Av.LMM)$w.J7)%TUU M !>v{{mL a j -4MMO ,;( (GQ'',;   m =l s   M'M
8	M
rZ   r   )r<   r@   returnc                     U S3U R                   ;  a  g[        XS9nU R                  nUR                  U;   a.  X#R                     nU(       d   e[	        [
        U5      nU" US9  gg)a  
Helper of the `xp` fixture.
Skip or xfail based on the ``skip_xp_backends`` or ``xfail_xp_backends`` markers.

See the "Support for the array API standard" docs page for usage examples.

Usage
-----
::
    skip_xp_backends = pytest.mark.skip_xp_backends
    xfail_xp_backends = pytest.mark.xfail_xp_backends
    ...

    @skip_xp_backends(backend, *, reason=None)
    @skip_xp_backends(*, cpu_only=True, exceptions=(), reason=None)
    @skip_xp_backends(*, eager_only=True, exceptions=(), reason=None)
    @skip_xp_backends(*, np_only=True, exceptions=(), reason=None)

    @xfail_xp_backends(backend, *, reason=None)
    @xfail_xp_backends(*, cpu_only=True, exceptions=(), reason=None)
    @xfail_xp_backends(*, eager_only=True, exceptions=(), reason=None)
    @xfail_xp_backends(*, np_only=True, exceptions=(), reason=None)

Parameters
----------
backend : str, optional
    Backend to skip/xfail, e.g. ``"torch"``.
    Mutually exclusive with ``cpu_only``, ``eager_only``, and ``np_only``.
cpu_only : bool, optional
    When ``True``, the test is skipped/xfailed on non-CPU devices,
    minus exceptions. Mutually exclusive with ``backend``.
eager_only : bool, optional
    When ``True``, the test is skipped/xfailed for lazy backends, e.g. those
    with major caveats when invoking ``__array__``, ``__bool__``, ``__float__``,
    or ``__complex__``, minus exceptions. Mutually exclusive with ``backend``.
np_only : bool, optional
    When ``True``, the test is skipped/xfailed for all backends other
    than the default NumPy backend and the exceptions.
    Mutually exclusive with ``backend``. Implies ``cpu_only`` and ``eager_only``.
reason : str, optional
    A reason for the skip/xfail. If omitted, a default reason is used.
exceptions : list[str], optional
    A list of exceptions for use with ``cpu_only``, ``eager_only``, or ``np_only``.
    This should be provided when delegation is implemented for some,
    but not all, non-CPU/non-NumPy backends.
r   N)r   r~   )keywordsr   r|   __name__getattrr;   )rZ   r   skip_xfail_reasonsrz   r   s        r&   r{   r{     so    ` %W-=-==6 
B	{{((#KK0v6V$	 )r`   c                 l   [        U 5      (       a  [        R                  " SS9  [        U 5      (       a  SS/$ [	        U 5      (       a  [        R                  " SS9  [        U 5      (       a'  U R                  5       R                  5       nS U 5       $ U R                  5       R                  5       S/-   $ )aG  Fixture that returns a list of all devices for the backend, plus None.
Used to test input->output device propagation.

Usage
-----
from scipy._lib._array_api import xp_device

def test_device(xp, devices):
    for d in devices:
        x = xp.asarray(..., device=d)
        y = f(x)
        assert xp_device(y) == xp_device(x)
zdata-apis/array-api-compat#293r~   rk   Nzjax-ml/jax#26000c              3   H   #    U  H  oR                   S :w  d  M  Uv   M     g7f)metaN)type).0devices     r&   	<genexpr>devices.<locals>.<genexpr>  s     FW6v0EWs   "	")r
   r;   r@   r   r   r   __array_namespace_info__devices)rz   r   s     r&   r   r     s     r{{ 	<=r{{t}bzz 	./||--/779FWFF&&(002dV;;r`   z.hypothesisnondeterministic)r    deadline
print_blobdeterministic)r    r   r   databasederandomizesuppress_health_checkSCIPY_HYPOTHESIS_PROFILEc              #     #    [        5       nSS/nU H  n[        [        SS9X'   M     / nU H  n[        [        S9X'   M     SSKJn  SS	/nU H  n[        UR
                  S
S9X'   M     / SQnU H  n[        [        S9X'   M     [        [        SS9[        S[        S9[        SUR
                  S9S.nUR                  U5        [        S5      n	SSK
Jn
  SSKnU
" 5          UR                  R                  S5        [        R                   " 5          U (       a7  U R"                  U;   a'  [        R$                  " S0 XR"                     D6  Sv   OWU (       a  U R"                  U	;   a  Sv   O;[        R&                  " S[(        5        [        R$                  " SS[        5        Sv   SSS5        SSS5        g! , (       d  f       N= f! , (       d  f       g= f7f)z]Temporarily turn (almost) all warnings to errors.

Filter out known warnings which we allow.
zscipy.linalg.normzscipy.ndimage.center_of_masszdivide by zero)rW   messagerp   r   )	integratezscipy.special.ellip_normalzscipy.special.ellip_harm_2zThe occurrence of roundoff)zscipy.stats.anderson_ksampzscipy.stats.kurtosistestzscipy.stats.normaltestscipy.sparse.linalg.normzExited at iterationzthe matrix subclass is not)r   rW   z"The maximum number of subdivisions)r   z
linalg.rstz	stats.rstscipy.signal.normalize)_fixed_default_rngNr.   errorz.*odr.*)r.   )dictRuntimeWarningDeprecationWarningscipyr   IntegrationWarningUserWarningPendingDeprecationWarningupdater   scipy._lib._utilr   rc   randomseedrB   rC   r    filterwarningsrD   Warning)testknown_warningsdivide_by_zeror    
deprecatedr   integration_wuser_wdctlegitr   r=   s               r&   warnings_errors_and_rngr     s       !?
 #D#'0@$BN  #
 
D#'1C#DN   	$55
 "D#'1M1M0L$NN  "
HD#'#=N   k3HI 979 A'::<

 	c" ,- 	8!IINN4 ((*DII7++Ryy8QRdii50))'7;++HiAST + "!** "!s7   C$G &1GBF>-G5	G >
G	G
GG )zscipy.linalg.LinAlgErrorzscipy.fftpack.fftshiftzscipy.fftpack.ifftshiftzscipy.fftpack.fftfreqzscipy.special.sinczscipy.optimize.show_optionsr   r   z$scipy.io.matlab.MatlabObject.stridesz"scipy.io.matlab.MatlabObject.dtypez"scipy.io.matlab.MatlabOpaque.dtypez$scipy.io.matlab.MatlabOpaque.stridesz&scipy.io.matlab.MatlabFunction.stridesz$scipy.io.matlab.MatlabFunction.dtype2)zscipy.io.hb_readzscipy.io.hb_writez)scipy.sparse.csgraph.connected_componentsz&scipy.sparse.csgraph.depth_first_orderz"scipy.sparse.csgraph.shortest_pathz#scipy.sparse.csgraph.floyd_warshallzscipy.sparse.csgraph.dijkstraz!scipy.sparse.csgraph.bellman_fordzscipy.sparse.csgraph.johnsonzscipy.sparse.csgraph.yenz(scipy.sparse.csgraph.breadth_first_orderz*scipy.sparse.csgraph.reverse_cuthill_mckeez$scipy.sparse.csgraph.structural_rankz*scipy.sparse.csgraph.construct_dist_matrixz%scipy.sparse.csgraph.reconstruct_pathzscipy.ndimage.value_indiceszscipy.stats.mstats.describe)zscipy.stats.distributionszscipy.optimize.cython_optimizez
scipy.testzscipy.show_configzscipy/special/_precomputez#scipy/interpolate/_interpnd_info.pyz'scipy/interpolate/_rbfinterp_pythran.pyzscipy/_build_utils/tempita.pyzscipy/_lib/array_api_compatzscipy/_lib/highszscipy/_lib/unuranzscipy/_lib/_gcutils.pyzscipy/_lib/doccer.pyzscipy/_lib/_uarrayz+scipy/linalg/_cython_signature_generator.pyzscipy/linalg/_generate_pyx.pyzscipy/linalg/_linalg_pythran.pyz$scipy/linalg/_matfuncs_sqrtm_triu.pyz1scipy/ndimage/utils/generate_label_testvectors.pyz scipy/optimize/_group_columns.pyz$scipy/optimize/_max_len_seq_inner.pyz"scipy/signal/_max_len_seq_inner.pyz%scipy/sparse/_generate_sparsetools.pyzscipy/special/_generate_pyx.pyzscipy/stats/_stats_pythran.pyzReST parser limitationz__cinit__ unexpected argumentznan in scalar_powerzintegration warning)zND_regular_grid.rstzextrapolation_examples.rstzsampling_pinv.rstzsampling_srou.rstzprobability_distributions.rstzintegrate.nquad(func,zio.rst)zoctave_a.matzoctave_cells.matzoctave_struct.matz.text()N)ujsonr#   r   r!   rB   tempfile
contextlibr   typingr   rc   r=   r;   
hypothesishypothesis_availableImportErrorscipy._lib._fpumoder   scipy._lib._array_apir   r   r   r	   r
   r   r   r   scipy._lib._testutilsr   "scipy._lib.array_api_extra.testingr   
scipy._libr   scipy_doctest.conftestr   
HAVE_SCPDTModuleNotFoundErrorpytest_run_parallelr   r   r'   rR   fixturer]   ra   r   r|   rL   array_api_backendsxp_available_backendsr   r   r   re   r   parse__version__Versionset_array_api_strict_flagsrd   set_default_deviceaddrH   rn   set_default_dtyperm   r:   rb   r   FutureWarningcupyx.scipyrq   	jax.numpyjaxthread_unsafer%   r   r   
dask.arrayarraydarh   xp_available_backend_ids
isinstancestrlowerloadsSCIPY_ARRAY_API_msgrz   skipifskip_xp_invalid_argr   FixtureRequestr{   configurationset_hypothesis_home_dirpathjoin
gettempdirsettingsregister_profiler   HealthCheckr8   r9   r   load_profiler   user_context_mgrskiplistpytest_extra_ignorepytest_extra_xfail
pseudocodelocal_resourcesstrict_check	stopwords)pr|   s   00r&   <module>r     s     	 
   %   ! -   7 F 0J#!
9Cx.b j$/C 0C ^^ 
#  LLv{{'E'EF   E !e $$LL).@%{{==?	@ ==)5569OOGHH33!	
$$LL7++002	3 	  .5 %))'2 ))19Ei##EMM2	!%%,IZ9  " 	$$LL&++002	3 	"%%f- 	;m	
 	'$$LL{;;11;;,,./	0 	

*D1

.L0I!0LM5 %))+6 	$''4$$LL;;11;;,,./	0 	$''5 /DD.C.CD'*;;;; 	?C((!!#+??tzz/:;w&":::236:J9KM o% $9%#8%88// #8%! ,-! .!H kk((I ) K 
> B;%v'<'< ;%-4_-E;%JN;%| #< #<L  44
X((*M: (($4 )  (($4":#9#9: )   "zz~~.H.= ?$$%=>  I IV "9I  I( 
~~!!# ' # 	,%I!>  8&><2)>$I   789I 
!I "I H%] K  ! !  J  #"#v  *  $  &  (    E%s   X% !X4 *Y (BY *BY  Y A#Y, 8CY9 A"Z +Z/ZZ%X10X14Y ?Y YYYYY)(Y),Y65Y69ZZZZ