
    = jw                        % S 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
rSSKJr  SSKJr  SSKJs  Js  J
r  SSKJrJr  SSKJr  \r\	\S	'   \\R4                  -  r\	\S
'   \R6                  R9                  SS5      r\\-  \S'   \R6                  R9                  SS5      r  " S S\RB                  5      r"\" S5      S\#S\"4S j5       r$S\S\4S jr%g)z|
Override functions from array_api_compat, for use by array-api-extra
and internally.

See also _array_api_compat_vendor.py
    N)	lru_cache)
ModuleType)Any	TypeAlias)array_api_compat)is_array_api_objis_jax_array)	SparseABCArray	ArrayLikeSCIPY_ARRAY_APIFSCIPY_DEVICEcpuc                   $    \ rS rSrSrSrSrSrSrg)_ArrayClsInfo    r             N)	__name__
__module____qualname____firstlineno__skipnumpy
array_likeunknown__static_attributes__r       o/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/scipy/_lib/_array_api_override.pyr   r       s    DEJGr    r   d   clsreturnc           
      t   [        U [        [        45      (       a  [        R                  $ [        U [
        5      (       a  Sn[        U5      e[        U [        R                  R                  5      (       a  [        S5      e[        U [        R                  5      (       a  [        S5      e[        U [        R                  [        R                  45      (       a  [        R                  $ [        U [        [         ["        [$        ['        S 5      45      (       a  [        R(                  $ [        R*                  $ )NzSparse arrays/matrices are not supported by this function. Perhaps one of the `scipy.sparse.linalg` functions would work instead.z8Inputs of type `numpy.ma.MaskedArray` are not supported.z0Inputs of type `numpy.matrix` are not supported.)
issubclasslisttupler   r   r
   
ValueErrornpmaMaskedArray	TypeErrormatrixndarraygenericr   intfloatcomplexbooltyper   r   )r#   msgs     r!   _validate_array_clsr7   '   s    #u~&&''' #y!!& o#ruu(())RSS#ryy!!JKK#

BJJ/00"""
 #UGT4:>??!!!   r    arraysc                  b   [         (       d  [        $ / n/ nU  GHV  n[        [        U5      5      nU[        R
                  L a  M-  U[        R                  L a  UR                  R                  S;   a  UR                  U5        Mm  UR                  R                  S:X  a#  [        U5      (       a  UR                  U5        M  [        SUR                  < S35      eU[        R                  L a#  [        U5      (       a  UR                  U5        M   [        R                  " U5      nUR                  R                  S;  a  [        SUR                  < S35      eUR                  U5        GMY     U(       d  [        $ [         R"                  " / UQUQ76 $ ! [         a    [        S5      ef = f)a  Get the array API compatible namespace for the arrays xs.

Parameters
----------
*arrays : sequence of array_like
    Arrays used to infer the common namespace.

Returns
-------
namespace : module
    Common namespace.

Notes
-----
Wrapper around `array_api_compat.array_namespace`.

1. Check for the global switch `SCIPY_ARRAY_API`. If disabled, just
   return array_api_compat.numpy namespace and skip all compliance checks.

2. Check for known-bad array classes.
   The following subclasses are not supported and raise and error:

   - `numpy.ma.MaskedArray`
   - `numpy.matrix`
   - NumPy arrays which do not have a boolean or numerical dtype
   - `scipy.sparse` arrays

3. Coerce array-likes to NumPy arrays and check their dtype.
   Note that non-scalar array-likes can't be mixed with non-NumPy Array
   API objects; e.g.

   - `array_namespace([1, 2])` returns NumPy namespace;
   - `array_namespace(np.asarray([1, 2], [3, 4])` returns NumPy namespace;
   - `array_namespace(cp.asarray([1, 2], [3, 4])` raises an error.
iufcbVzAn argument has dtype `z3`; only boolean and numerical dtypes are supported.zCAn argument is neither array API compatible nor coercible by NumPy.)r   	np_compatr7   r5   r   r   r   dtypekindappendr	   r-   r   r   r*   
asanyarrayr   array_namespace)r8   numpy_arrays
api_arraysarrayarr_infos        r!   rA   rA   E   s   H ?LJ&tE{3}))),,,{{7*##E*!!S(\%-@-@ !!%("9%++ IS !S T T ...3CE3J3Je$7e, {{w."9%++ IS !S T T&; B  ++G\GJGG  7 !6 7 77s   FF.)&__doc__enumos	functoolsr   typesr   typingr   r   r   r*   numpy.typingnpt
scipy._libr   !scipy._lib.array_api_compat.numpy_libr<   scipy._lib.array_api_compatr   r	   scipy._lib._sparser
   r   __annotations__r   environgetr   strr4   r   Enumr   r5   r7   rA   r   r    r!   <module>rX      s     	   !   ' 5 5 F ( y s}},	9 , !jjnn->Ft Fzz~~ne4DII  3!T !m ! !:QHU QHz QHr    