
    (phV              
          S SK r S SKrS SKrS SKrS SKJr  S SKrS SKJ	r
  S SKrS SKrS SKJr  S SKJr  S SKJrJr  S SKJr   S SKJr  Sr S SKrSrS
 rS r\R>                  " SSS9S 5       r \(       d  \R>                  S 5       r!S\0r"\(       Gad  \#" \\$5      (       GaU   S SK%r%\"RM                  S\%05        \RN                  " \%RP                  5      \RR                  " S5      :  a  \*" S5      e\%RV                  " SS9   S SK,r,\"RM                  S\,05        \,RZ                  " \5         S SK.r.\"RM                  S\.05         S SK/r0\"RM                  S\0R                  05        \0Rb                  RM                  SS5        \0Rb                  RM                  S\0Rd                  " \5      S    5        \Rf                  " 5       S;  a1  \ Rh                  " \5      r5S\5;   a  O \5 V s0 s H	  n U \"U    _M     sn r"S\";   a  Sr\Rt                  Rw                  S\"Ry                  5       5      r=\Rt                  R}                  \S S!9r?S" r@\R>                  S# 5       rA\R>                  S$ 5       rBS9S% jrC\R                  R                  \R                  R                  \R                  " 5       S&5      5        \R                  R                  S'SSS(9  \R                  R                  S)SSSS\K" \R                  5      S*9  \R                  R                  S+S)5      rO\R                  R                  \O5        \(       a  \S:S, j5       rQ\Q\lR        \S" / S-Q5      \lT        \RP                  S.:  a#  \R                  RM                  \S" / S/Q5      5        / S0Q\lU        S1S1S2S3S4S5.\lV        \S" S6/5      \lW        S7/ S8Q0\lX        S\lY        gg! \ a    S	r GNf = f! \ a    S	r GNf = f! \* a     GNf = f! \* a     GNf = f! \* a     GNf = f! \* a     GNbf = fs  sn f ! \6 a    S\"Ro                  5        3r8\9" \85      ef = f);    N)contextmanager)get_fpu_mode)FPUModeChangeWarning)SCIPY_ARRAY_APISCIPY_DEVICE)_pep440)	dt_configTFc                    U R                  SS5        U R                  SS5        U R                  SS5         SS Kn SSKJn  U R                  SS	5        U R                  SS
5        [
        (       d7  U R                  SS5        U R                  SS5        U R                  SS5        g g ! [         a    U R                  SS5         Nf = f! [         a    U R                  SS5         Nf = f)N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 platformsr   z.timeout: mark a test for a non-default timeout)parse_durationz8fail_slow: mark a test for a non-default timeout failurezskip_xp_backends(backends, reason=None, np_only=False, cpu_only=False, exceptions=None): mark the desired skip configuration for the `skip_xp_backends` fixture.zxfail_xp_backends(backends, reason=None, np_only=False, cpu_only=False, exceptions=None): mark the desired xfail configuration for the `xfail_xp_backends` fixture.zOparallel_threads(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)addinivalue_linepytest_timeout	Exceptionpytest_fail_slowr   PARALLEL_RUN_AVAILABLE)configr   r   s      A/var/www/html/venv/lib/python3.13/site-packages/scipy/conftest.pypytest_configurer      s!   
I)+
IRT
IBDIS 	4 I	RS I	TU "!!	" 	F	
 	Q	
 "%  IG	II  SQ	SSs"   B* C *C	C	C+*C+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        nUR                  [        R                   5         SS
KJn  SnU(       af   [        [        R                  S   5      n[        R*                  " S5      (       d.  [        R,                  " 5       S-  n[/        Xv-  S5      n W" USS9  S S S 5        g ! [
         a    Sn GN>f = 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): )threadpool_limitsTPYTEST_XDIST_WORKER_COUNTOMP_NUM_THREADS      blas)user_api)get_closest_markerintosenvironget
ValueErrorpytestskipnpintpitemsizexfailargsnptsuppress_warningsfilter PytestUnraisableExceptionWarningthreadpoolctlr   r   KeyErrorgetenv	cpu_countmax)	itemmarkvsupr   HAS_THREADPOOLCTLxdist_worker_countmax_openmp_threadsthreads_per_workers	            r   pytest_runtest_setupr@   I   s   ""7+D	BJJNN=#67A KK K L""#34DBGGAJ//!3=diil^LM 
			 C

6::;	&7 $
 
%(4O)P%Q"
 99.//%'\\^q%8"%();)QST%U"%&86J5 
!	   	A	$  	& %	&  ) 
!	 $ !  = 
!	 67 
!	 s   )E.  G0F8G FAGF+.E>=E>FGFG
F(G'F((G+
G 5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   warningswarnr   )requestold_modenew_modes      r   check_fpu_moderL   z   sQ     
 ~H	~H.xm4} M! !3	C s   AAc                      g)Nr    rN       r   num_parallel_threadsrP      s    rO   numpyarray_api_strictz2.0z'array-api-strict must be >= version 2.0z2023.12)api_versiontorchcupy	jax.numpyjax_enable_x64jax_default_device)1trueallz!'--array-api-backend' must be in cudaxpzsTest involves masked arrays, object arrays, or other types that are not valid input when `SCIPY_ARRAY_API` is used.reasonc                    U R                   U S3   R                  n[        U5      S:  a  [        SU 35      e[	        U R
                  R                  U S35      5      n/ n0 nU H  nUR                  R                  S5      (       a%  SUS'   UR                  R                  S/ 5      US'   OZUR                  R                  S5      (       a:  UR                  S5      (       d$  SUS'   UR                  R                  S/ 5      US'   [        UR                  5      S:  d  M  UR                  S   nUR                  U5        UR                  " S	0 XvR                  0D6  M     XE4$ )
z%A helper for {skip,xfail}_xp_backends_xp_backendsr   zmultiple backends: np_onlyT
exceptionscpu_onlyr   rN   )keywordsr.   lenr'   listnodeiter_markerskwargsr&   appendupdate)rI   skip_or_xfailargs_r   backendsrj   markerbackends           r   _backends_kwargs_from_requestrr      sE    l;<AAE
5zA~ .ug6777<<,,l-KLMGHF==Y'' $F9#)==#4#4\2#FF< ]]z**::i((%)z"'-}}'8'8r'J|$ v{{akk!nGOOG$MM5Wmm45   rO   c                 T    SUR                   ;  a  g[        USS9u  p#[        XUSS9  g)a  skip_xp_backends(backend=None, reason=None, np_only=False, cpu_only=False, exceptions=None)

Skip a decorated test for the provided backend, or skip a category of backends.

See ``skip_or_xfail_backends`` docstring for details. Note that, contrary to
``skip_or_xfail_backends``, the ``backend`` and ``reason`` arguments are optional
single strings: this function only skips a single backend at a time.
To skip multiple backends, provide multiple decorators.
skip_xp_backendsNr)   rm   re   rr   skip_or_xfail_xp_backendsr]   rI   ro   rj   s       r   rt   rt      s0     !1!114WFSHbF&IrO   c                 T    SUR                   ;  a  g[        USS9u  p#[        XUSS9  g)a  xfail_xp_backends(backend=None, reason=None, np_only=False, cpu_only=False, exceptions=None)

xfail a decorated test for the provided backend, or xfail a category of backends.

See ``skip_or_xfail_backends`` docstring for details. Note that, contrary to
``skip_or_xfail_backends``, the ``backend`` and ``reason`` arguments are optional
single strings: this function only xfails a single backend at a time.
To xfail multiple backends, provide multiple decorators.
xfail_xp_backendsNr-   ru   rv   rx   s       r   rz   rz     s0     '"2"224WGTHbF'JrO   c                 t   [        [        U5      nUR                  SS5      nUR                  SS5      nUR                  S/ 5      nUR                  S5      =n(       a  [        SU< S35      eU(       a	  U(       a  SnU(       a  U(       d  U(       d  [        S5      eU(       ah  UR                  S	S
5      n[	        U[
        5      (       d  [        U5      S:  a  [        S5      eU R                  S:w  a  U R                  U;  a  U" US9  gU(       a  SnUc  / OUn[        (       a  [        S:w  a  U R                  S:X  a  SU;  a  U" US9  OU R                  S:X  a6  SU;  a0  SU R                  S5      R                  R                  ;  a  U" US9  OTU R                  S:X  aD  SU;  a>  U R                  S5      R                  5        H  n	SU	R                  ;  d  M  U" US9  M     UbL  [        U5       H<  u  pU R                  U:X  d  M  X+   R                  S	5      nU(       d  SU 3nU" US9  M>     gg)a  
Skip based on the ``skip_xp_backends`` or ``xfail_xp_backends`` marker.

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

Parameters
----------
backends : tuple
    Backends to skip/xfail, e.g. ``("array_api_strict", "torch")``.
    These are overriden when ``np_only`` is ``True``, and are not
    necessary to provide for non-CPU backends when ``cpu_only`` is ``True``.
    For a custom reason to apply, you should pass a dict ``{'reason': '...'}``
    to a keyword matching the name of the backend.
reason : str, optional
    A reason for the skip/xfail in the case of ``np_only=True``.
    If unprovided, a default reason is used. Note that it is not possible
    to specify a custom reason with ``cpu_only``.
np_only : bool, optional
    When ``True``, the test is skipped/xfailed for all backends other
    than the default NumPy backend. There is no need to provide
    any ``backends`` in this case. To specify a reason, pass a
    value to ``reason``. Default: ``False``.
cpu_only : bool, optional
    When ``True``, the test is skipped/xfailed on non-CPU devices.
    There is no need to provide any ``backends`` in this case,
    but any ``backends`` will also be skipped on the CPU.
    Default: ``False``.
exceptions : list, optional
    A list of exceptions for use with ``cpu_only`` or ``np_only``.
    This should be provided when delegation is implemented for some,
    but not all, non-CPU/non-NumPy backends.
skip_or_xfail : str
    ``'skip'`` to skip, ``'xfail'`` to xfail.
rb   Frd   rc   reasonsz.provide a single `reason=` kwarg; got reasons=z insteadz<`exceptions` is only valid alongside `cpu_only` or `np_only`r_   z#do not run with non-NumPy backends.r   z8please provide a singleton `reason` when using `np_only`rQ   r^   NzTno array-agnostic implementation or delegation available for this backend and devicecpurU   rT   r   rV   z#do not run with array API backend: )getattrr(   r&   r'   
isinstancestrrf   __name__r   r   emptydevicetypedevicesdevice_kind	enumerate)r]   ro   rj   rm   rb   rd   rc   r|   r_   dirq   s               r   rw   rw     s   F FM2MjjE*Gzz*e,HL"-J**Y''w'J'8TUU 88wWXXH&KL&#&&3v;? 4 5 5;;'!bkk&C(0%-R:
?|u4{{f$z)AV,'G:,E 2 2 7 77!0+:0M!,,.AAMM1%V4 / #H-JA{{g%,,X6B7)LFV, . rO   z.hypothesisnondeterministic)name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     / SQ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   O;U (       a  U R"                  U	;   a  Sv   O[        R&                  " 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)rE   message)zscipy.signal.cwtzscipy.signal.morletzscipy.signal.morlet2zscipy.signal.rickerzscipy.integrate.simpsonzscipy.interpolate.interp2dzscipy.linalg.kron)rE   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   rE   z"The maximum number of subdivisions)r   z
linalg.rstz	stats.rstscipy.signal.normalize)_fixed_default_rngNerror)ignore)dictRuntimeWarningDeprecationWarningscipyr   IntegrationWarningUserWarningPendingDeprecationWarningrl   setscipy._lib._utilr   rQ   randomseedrG   catch_warningsr   filterwarningssimplefilter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++ I.<YY.GIdii50))'7; + "!** "!s7   C&G(1F5A:F$F5	G$
F2	.F55
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/_lib/array_api_compatzscipy/_lib/highszscipy/_lib/unuranzscipy/_lib/_gcutils.pyzscipy/_lib/doccer.pyzscipy/_lib/_uarrayz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.mat)r)   )N)Zjsonr$   rG   tempfile
contextlibr   rQ   r*   numpy.testingtestingr/   r(   
hypothesisscipy._lib._fpumoder   scipy._lib._testutilsr   scipy._lib._array_apir   r   
scipy._libr   scipy_doctest.conftestr	   
HAVE_SCPDTModuleNotFoundErrorpytest_run_parallelr   r   r   r@   fixturerL   rP   xp_available_backendsr   r   rR   rl   parse__version__VersionImportErrorset_array_api_strict_flagsrT   set_default_devicerU   	jax.numpyjaxr   r   lowerloadsSCIPY_ARRAY_API_r4   keysmsgr'   r9   parametrizevaluesarray_api_compatibleskipifskip_xp_invalid_argrr   rt   rz   rw   configurationset_hypothesis_home_dirpathjoin
gettempdirsettingsregister_profilerg   HealthCheckr%   r&   r   load_profiler   user_context_mgrr   skiplistpytest_extra_ignorepytest_extra_xfail
pseudocodelocal_resourcesstrict_check)rq   s   0r   <module>r      s    	   %     , 6 ? 0J#!
'
T.b j$/C 0C ^^ 
 !" z/377	$$&8:J%KL==)5569OOGHH33!	
$$gu%56  .$$fd^4$$k399%=>

*D1

.L0I!0LM
 m3::o6$$& $4)#3 27;;#3)% 
""L{{..t5J5Q5Q5ST kk((I ) K 
> J J" K K P-l    0 0GGLL$$&6    $ $	dt %     $ $	dTtz556 %  ::>>*D*9;  
      !9 :  O Ob "9I  I( 
~~!!# ' # 	,%I!$  8&><2)>$I   789I 
!I "II ]  J  #"#B        )  &9:O:T:T:V9WX o%&s   O O %AO% )O2 /O? A,P "P &P6P OOO"!O"%O/.O/2O<;O<?P	P	PPP "Q 