
    {Kgo                        d Z ddlZddlZddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ dd	hZd0dZd0dZd Zd Zd
efddZd Zd Zd Zd Zd Zd Zd Z G d d      Zd Zd Z G d d      Z e       Zd
efddZd
efddd Z d
efdd!Z!d1d"Z"d# Z#d$ Z$d2d%Z%d3d&Z&d3d'Z'	 d4ddd(d)Z(d1d*Z)d+ Z*d, Z+d- Z,d. Z-d3d/Z.y)5zTools to support array_api.    Nwraps   )
get_config   )parse_versionnumpyzarray_api_compat.numpyTc              #   8   K   dD ]  }| s	|t         v r|  yw)a7  Yield supported namespace.

    This is meant to be used for testing purposes only.

    Parameters
    ----------
    include_numpy_namespaces : bool, default=True
        If True, also yield numpy namespaces.

    Returns
    -------
    array_namespace : str
        The name of the Array API namespace.
    )r	   array_api_strictcupycupy.array_apitorchN)_NUMPY_NAMESPACE_NAMES)include_numpy_namespacesarray_namespaces     \/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/sklearn/utils/_array_api.pyyield_namespacesr      s(      (O?U,Us   c              #      K   t        |       D ];  }|dk(  r-t        j                  dd      D ]  \  }}|||f  |ddf 5|ddf = yw)a  Yield supported namespace, device, dtype tuples for testing.

    Use this to test that an estimator works with all combinations.

    Parameters
    ----------
    include_numpy_namespaces : bool, default=True
        If True, also yield numpy namespaces.

    Returns
    -------
    array_namespace : str
        The name of the Array API namespace.

    device : str
        The name of the device on which to allocate the arrays. Can be None to
        indicate that the default value should be used.

    dtype_name : str
        The name of the data type to use for arrays. Can be None to indicate
        that the default value should be used.
    )r   r   )cpucuda)float64float32mpsr   N)r   	itertoolsproduct)r   r   devicedtypes       r   )yield_namespace_device_dtype_combinationsr   0   sn     . ,!9 g%!*!2!2!7" &vu44" "5)33!4--s   AAc                     | r>	 ddl }t        t        j                        }d}|t        |      k  rt        d| d      yy# t        $ r t        d      w xY w)zCheck that array_api_compat is installed and NumPy version is compatible.

    array_api_compat follows NEP29, which has a higher minimum NumPy version than
    scikit-learn.
    r   NzKarray_api_compat is required to dispatch arrays using the API specificationz1.21zNumPy must be z7 or newer to dispatch array using the API specification)array_api_compatImportErrorr   r	   __version__)array_api_dispatchr    numpy_versionmin_numpy_versions       r   _check_array_api_dispatchr&   T   s     	# &e&7&78"=):;; !2 3 4) )  <   	! 	s   A Ac                     t        | t        j                  t        j                  f      st	        | d      sy| j
                  S )z0Hardware device where the array data resides on.r   r   )
isinstancer	   ndarraygenerichasattrr   )arrays    r   _single_array_devicer-   l   s5    %%--78xA ||    remove_noneremove_typesc           	          t        || |d}t        |d         }|dd D ]5  }t        |      }||k7  st        dt        |       dt        |              |S )aD  Hardware device where the array data resides on.

    If the hardware device is not the same for all arrays, an error is raised.

    Parameters
    ----------
    *array_list : arrays
        List of array instances from NumPy or an array API compatible library.

    remove_none : bool, default=True
        Whether to ignore None objects passed in array_list.

    remove_types : tuple or list, default=(str,)
        Types to ignore in array_list.

    Returns
    -------
    out : device
        `device` object (see the "Device Support" section of the array API spec).
    r/   r   r   Nz$Input arrays use different devices: , )_remove_non_arraysr-   
ValueErrorstr)r0   r1   
array_listdevice_r,   device_others         r   r   r   v   sz    * $	<J
 #:a=1G AB+E2l"6s7|nB|$%'    Nr.   c                 @    t        j                  | j                        S )zReturn the total number of elements of x.

    Parameters
    ----------
    x : array
        Array instance from NumPy or an array API compatible library.

    Returns
    -------
    out : int
        Total number of elements.
    )mathprodshape)xs    r   sizer?      s     99QWWr.   c                 &    | j                   t        v S )z%Return True if xp is backed by NumPy.)__name__r   xps    r   _is_numpy_namespacerD      s    ;;000r.   c                 *   t        |      r%|j                  t        j                  | |            S | j                  |j                  cxk(  rdk(  sJ  J |j                  |j                  |j                  |       |j                  |      g            S )Nr   )rD   asarrayr	   union1dndimunique_valuesconcat)abrC   s      r   _union1drM      sz    2zz%--1-..66QVV q     BIIr'7'7':B<L<LQ<O&PQRRr.   c                l     t        |t              rt         fd|D              S t         |      S )zReturns a boolean indicating whether a provided dtype is of type "kind".

    Included in the v2022.12 of the Array API spec.
    https://data-apis.org/array-api/latest/API_specification/generated/array_api.isdtype.html
    c              3   :   K   | ]  }t        |         ywrB   N_isdtype_single.0kr   rC   s     r   	<genexpr>zisdtype.<locals>.<genexpr>   s     BT?5!33T   rB   )r(   tupleanyrR   )r   kindrC   s   ` `r   isdtyper[      s/     $BTBBBudr22r.   c                    t        |t              r3|dk(  r j                  k(  S |dk(  r0 j                  j                  j
                  j                  hv S |dk(  r0 j                  j                  j                  j                  hv S |dk(  rt         fddD              S |dk(  r t              v S |dk(  r\t               }t        d	      r|j                  j                          t        d
      r|j                  j"                          |v S |dk(  rt         fddD              S t%        d|       |k(  S )Nboolsigned integerunsigned integerintegralc              3   :   K   | ]  }t        |         ywrP   rQ   rS   s     r   rV   z"_isdtype_single.<locals>.<genexpr>   s%      ?A  qR00?rW   )r^   r_   real floatingcomplex floating	complex64
complex128numericc              3   :   K   | ]  }t        |         ywrP   rQ   rS   s     r   rV   z"_isdtype_single.<locals>.<genexpr>   s%      JA  qR00JrW   )r`   rb   rc   zUnrecognized data type kind: )r(   r6   r]   int8int16int32int64uint8uint16uint32uint64rY   supported_float_dtypessetr+   addrd   re   r5   )r   rZ   rC   complex_dtypess   ` ` r   rR   rR      sN   $6>BGG##%%RWWbhh"((CCC''RXXryy"))RYYGGGZ ?   _$22666'' UNr;'""2<<0r<(""2==1N**Y J  
 <THEFF}r.   c                     t        | d      r#| j                  | j                  | j                  fS | j                  | j                  fS )aA  Supported floating point types for the namespace.

    Note: float16 is not officially part of the Array API spec at the
    time of writing but scikit-learn estimators and functions can choose
    to accept it when xp.float16 is defined.

    https://data-apis.org/array-api/latest/API_specification/data_types.html
    float16)r+   r   r   ru   rB   s    r   rp   rp      s:     r9

BJJ

33

BJJ''r.   c                     t        |       \  }}|r,t        |       }|D cg c]  }|j                  ||       c}S |S c c}w )a  Ensure that all arrays use the same namespace and device as reference.

    If neccessary the arrays are moved to the same namespace and device as
    the reference array.

    Parameters
    ----------
    reference : array
        Reference array.

    *arrays : array
        Arrays to check.

    Returns
    -------
    arrays : list
        Arrays with the same namespace and device as reference.
    r   )get_namespacer   rF   )	referencearraysrC   is_array_apir8   rK   s         r   ensure_common_namespace_devicer|      sL    & %Y/B#7=>v!

1W
-v>> ?s   ?c                   (    e Zd ZdZd Zd Zd Zd Zy)_ArrayAPIWrappera  sklearn specific Array API compatibility wrapper

    This wrapper makes it possible for scikit-learn maintainers to
    deal with discrepancies between different implementations of the
    Python Array API standard and its evolution over time.

    The Python Array API standard specification:
    https://data-apis.org/array-api/latest/

    Documentation of the NumPy implementation:
    https://numpy.org/neps/nep-0047-array-api-standard.html
    c                     || _         y N
_namespace)selfr   s     r   __init__z_ArrayAPIWrapper.__init__%  s	    )r.   c                 .    t        | j                  |      S r   )getattrr   )r   names     r   __getattr__z_ArrayAPIWrapper.__getattr__(  s    t--r.   c                 4    | j                   |j                   k(  S r   r   )r   others     r   __eq__z_ArrayAPIWrapper.__eq__+  s    %"2"222r.   c                 2    t        ||| j                        S NrB   )r[   r   r   r   rZ   s      r   r[   z_ArrayAPIWrapper.isdtype.  s    udt77r.   N)rA   
__module____qualname____doc__r   r   r   r[    r.   r   r~   r~     s    *.38r.   r~   c                 (    | dvrt        d|       y )N>   Nr   zUnsupported device for NumPy: )r5   rw   s    r   _check_device_cpur   2  s"    ]"9&DEE #r.   c                 .     t                fd       }|S )Nc                  J    t        |j                  dd               | i |S )Nr   )r   pop)argskwargsfuncs     r   wrapped_funcz(_accept_device_cpu.<locals>.wrapped_func8  s&    &**Xt45T$V$$r.   r   )r   r   s   ` r   _accept_device_cpur   7  s!    
4[% % r.   c                       e Zd ZdZh dZh dZd Zed        Zdddd	Z	d
d
d
ddZ
d Zd Zd Zd
ddZd
ddZd Zy
)_NumPyAPIWrappera  Array API compat wrapper for any numpy version

    NumPy < 2 does not implement the namespace. NumPy 2 and later should
    progressively implement more an more of the latest Array API spec but this
    is still work in progress at this time.

    This wrapper makes it possible to write code that uses the standard Array
    API while working with any version of NumPy supported by scikit-learn.

    See the `get_namespace()` public function for more details.
    >   eyefullonesemptyzerosarangelinspace	full_like	ones_like
empty_like
zeros_like>   rh   ri   rj   rk   rl   rm   rn   ro   ru   r   r   rd   re   c                     t        t        |      }|| j                  v rt        |      S || j                  v rt        j
                  |      S |S r   )r   r	   _CREATION_FUNCSr   _DTYPESr   )r   r   attrs      r   r   z_NumPyAPIWrapper.__getattr__t  sK    ud# 4'''%d++ 4<<;;t$$r.   c                 "    t         j                  S r   )r	   bool_)r   s    r   r]   z_NumPyAPIWrapper.bool  s    {{r.   Tunsafecopycastingc                *    |j                  |||      S )Nr   )astype)r   r>   r   r   r   s        r   r   z_NumPyAPIWrapper.astype  s    xxD'x::r.   N)r   r   r   c                ~    t        |       |du rt        j                  |d|      S t        j                  ||      S )NT)r   r   r   )r   r	   r,   rF   )r   r>   r   r   r   s        r   rF   z_NumPyAPIWrapper.asarray  s5    &!4<;;qt599==%00r.   c                 0    t        j                  |d      S )NT)return_inverser	   uniquer   r>   s     r   unique_inversez_NumPyAPIWrapper.unique_inverse  s    ||Ad33r.   c                 0    t        j                  |d      S )NT)return_countsr   r   s     r   unique_countsz_NumPyAPIWrapper.unique_counts  s    ||AT22r.   c                 ,    t        j                  |      S r   r   r   s     r   rI   z_NumPyAPIWrapper.unique_values  s    ||Ar.   axisc                0    t        j                  ||      S )Nr   )r	   concatenate)r   rz   r   s      r   rJ   z_NumPyAPIWrapper.concat  s      d33r.   )r   c                    t        |t              st        d|dt        |             |du r|j	                         }t        j                  ||      S )zGives a new shape to an array without changing its data.

        The Array API specification requires shape to be a tuple.
        https://data-apis.org/array-api/latest/API_specification/generated/array_api.reshape.html
        zshape must be a tuple, got z	 of type T)r(   rX   	TypeErrortyper   r	   reshape)r   r>   r=   r   s       r   r   z_NumPyAPIWrapper.reshape  sT     %'-eYiU}M  4<A}}Q&&r.   c                     t        |||       S r   )r[   r   s      r   r[   z_NumPyAPIWrapper.isdtype  s    udt,,r.   )rA   r   r   r   r   r   r   propertyr]   r   rF   r   r   rI   rJ   r   r[   r   r.   r   r   r   @  sp    
$OG$
   (,X ; #'t$ 143 &* 4 )- '-r.   r   c                     g }t        |      }|D ]%  }| r|t        ||      r|j                  |       ' |sAt        d| ddj	                  d |D               ddj	                  d |D               d      |S )a  Filter arrays to exclude None and/or specific types.

    Raise ValueError if no arrays are left after filtering.

    Parameters
    ----------
    *arrays : array objects
        Array objects.

    remove_none : bool, default=True
        Whether to ignore None objects passed in arrays.

    remove_types : tuple or list, default=(str,)
        Types to ignore in the arrays.

    Returns
    -------
    filtered_arrays : list
        List of arrays with None and typoe
    zCAt least one input array expected after filtering with remove_none=z, remove_types=[r3   c              3   4   K   | ]  }|j                     y wr   )rA   )rT   ts     r   rV   z%_remove_non_arrays.<locals>.<genexpr>  s     &H<aqzz<s   z]. Got none. Original types: [c              3   F   K   | ]  }t        |      j                    y wr   )r   rA   )rT   rK   s     r   rV   z%_remove_non_arrays.<locals>.<genexpr>  s     )KFq$q'*:*:Fs   !z].)rX   r(   appendr5   join)r0   r1   rz   filtered_arraysr,   s        r   r4   r4     s    * O&L5=e\*u%  Rk^ T!YY&H<&HHI J  $		)KF)K KLBP
 	

 r.   )r0   r1   rC   c                     t               d   }|s||dfS t        dfS ||dfS t        || |d}t        |       ddl} |j
                  | d}}|j                  dv rt        |      }||fS )a  Get namespace of arrays.

    Introspect `arrays` arguments and return their common Array API compatible
    namespace object, if any.

    See: https://numpy.org/neps/nep-0047-array-api-standard.html

    If `arrays` are regular numpy arrays, an instance of the `_NumPyAPIWrapper`
    compatibility wrapper is returned instead.

    Namespace support is not enabled by default. To enabled it call:

      sklearn.set_config(array_api_dispatch=True)

    or:

      with sklearn.config_context(array_api_dispatch=True):
          # your code here

    Otherwise an instance of the `_NumPyAPIWrapper` compatibility wrapper is
    always returned irrespective of the fact that arrays implement the
    `__array_namespace__` protocol or not.

    Parameters
    ----------
    *arrays : array objects
        Array objects.

    remove_none : bool, default=True
        Whether to ignore None objects passed in arrays.

    remove_types : tuple or list, default=(str,)
        Types to ignore in the arrays.

    xp : module, default=None
        Precomputed array namespace module. When passed, typically from a caller
        that has already performed inspection of its own inputs, skips array
        namespace inspection.

    Returns
    -------
    namespace : module
        Namespace shared by array objects. If any of the `arrays` are not arrays,
        the namespace defaults to NumPy.

    is_array_api_compliant : bool
        True if the arrays are containers that implement the Array API spec.
        Always False when array_api_dispatch=False.
    r#   NFTr/   r   >   r   )r   _NUMPY_API_WRAPPER_INSTANCEr4   r&   r    rx   rA   r~   )r0   r1   rC   rz   r#   r    	namespaceis_array_api_compliants           r   rx   rx     s    d $&:;>u9.55	~4x	[|F 01 (F(8(F(F(OQU%I //$Y/	,,,r.   c                 z    t        || |d}t        dg       }t        |i |\  }}|r||t        |i |fS |ddfS )zECombination into one single function of `get_namespace` and `device`.r/   FN)r4   dictrx   r   )r0   r1   r7   skip_remove_kwargsrC   r{   s         r   get_namespace_and_devicer   +  sf    #	<J %bA$jG4FGBJ5"45
 	
 5$r.   c                     t        | |      \  }}t        |      r7|j                  t        j                  t        j                  |                   S dd|j                  |        z   z  S )NrB   g      ?)rx   rD   rF   specialexpitr	   exp)XrC   _s      r   _expitr   >  sU    !#EB2zz'--a(89::#r
"##r.   c                    |j                  || j                        }t        |      rPt        j                   |       }|j                  d d | j
                  d   dz   xx   |z  cc<   |j                  |      S |j                  dk(  r0t        | j
                  d         D ]  }| ||fxx   ||   z  cc<    y t        | j
                  d         D ]  }| ||fxx   |z  cc<    y )Nr   r   r   )rF   r   rD   r	   flatr=   rH   range)r,   valuerC   array_npis        r   _add_to_diagonalr   F  s     JJuEKKJ0E2=='+Q!++,5,zz(##	qu{{1~&A!Q$K58#K ' u{{1~&A!Q$K5 K 'r.   c                    |D cg c]  }t        |d      s| }}|D cg c]+  }| j                  |j                  d      s |j                  - }}|r | j                  | S | j	                  d      j                  S c c}w c c}w )a  Find a suitable floating point dtype when computing with arrays.

    If any of the arrays are floating point, return the dtype with the highest
    precision by following official type promotion rules:

    https://data-apis.org/array-api/latest/API_specification/type_promotion.html

    If there are no floating point input arrays (all integral inputs for
    instance), return the default floating point dtype for the namespace.
    r   rb           )r+   r[   r   result_typerF   )rC   rz   rK   dtyped_arraysfloating_dtypess        r   _find_matching_floating_dtyper   W  s     !'>1'!W*=QM>&&A"**QWWo*N   r~~//
 ::c?    ?s   A?A?!BBc           	         t        | |      \  }}}t        |      rR|r'|j                  t        j                  | ||            S |'|%|j                  t        j
                  | |            S |j                  | |      } ||j                  ||      }|| j                  |j                  k7  r|8t        dt        | j                         dt        |j                         d      t        |j                        | j                  |   fk7  r;t        dt        |j                         dt        | j                         d|d	      d
g| j                  z  }| j                  |   ||<   |j                  ||      }|j                  | j                  d      rt        d      |'|j                  |j                  d      rt        d      t        | ||      }|j!                  | |      } |" |r|j"                  n|j$                  | |      S |j!                  ||      }|j%                  |j'                  | |      |      }	|s|	S |j%                  ||      }
|j)                  |
dk(        rt+        d      |	|
z  S )a  Partial port of np.average to support the Array API.

    It does a best effort at mimicking the return dtype rule described at
    https://numpy.org/doc/stable/reference/generated/numpy.average.html but
    only for the common cases needed in scikit-learn.
    )r   weightsrw   z+Axis must be specified when the shape of a z and weights z differ.zShape of weights weights.shape=z! must be consistent with a.shape=z
 and axis=.r   rc   z;Complex floating point values are not supported by average.rB   r   r   z(Weights sum to zero, can't be normalized)r   rD   rF   r	   averagedotr=   r   rX   r5   rH   r   r[   r   NotImplementedErrorr   r   meansummultiplyrY   ZeroDivisionError)rK   r   r   	normalizerC   r   r8   r=   output_dtypesum_scales              r   _averager   p  sh    .a9NB72::emmAD'JKK\g1::eii7344


1W
%A**WW*5qww'--7<=eAGGn=M N /0: 
 AGGDM#331%2F1G H++0>*:+waI  affggdmd**We,	zz!''-.!I
 	
 rzz'--9KL!I
 	
 1GCL
		!\"A09"&&!$??ii.G66"++a)65DFF7F&E	vvesl JKK%<r.   c                    t        | |      \  }}t        |      r&|j                  t        j                  | |            S |j                  |       }|j                  |j                  ||j                  |j                  t        |             |       |      } |j                  ||      }|j                  |      r,|j                  ||j                  |j                        |       } | S NrB   r   rw   )rx   rD   rF   r	   nanminisnanminwhereinfr   allrY   nanr   r   rC   r   masks        r   _nanminr	         !#EB2zz%,,qt455 xx{FF288D"**bffWVAY*"GKRVFWvvdv&66$<rzz"&&115Ar.   c                    t        | |      \  }}t        |      r&|j                  t        j                  | |            S |j                  |       }|j                  |j                  ||j                  |j                   t        |             |       |      } |j                  ||      }|j                  |      r,|j                  ||j                  |j                        |       } | S r   )rx   rD   rF   r	   nanmaxr  maxr  r  r   r  rY   r  r  s        r   _nanmaxr    r
  r.   )rC   r   c                    t        | |      \  }}t        |      rF|du rt        j                  | ||      } nt        j                  | ||      } |j	                  |       S |j	                  | |||      S )a  Helper to support the order kwarg only for NumPy-backed arrays

    Memory layout parameter `order` is not exposed in the Array API standard,
    however some input validation code in scikit-learn needs to work both
    for classes and functions that will leverage Array API only operations
    and for code that inherently relies on NumPy backed data containers with
    specific memory layout constraints (e.g. our own Cython code). The
    purpose of this helper is to make it possible to share code for data
    container validation without memory copies for both downstream use cases:
    the `order` parameter is only enforced if the input array implementation
    is NumPy based, otherwise `order` is just silently ignored.
    rB   T)orderr   )r   r   r   )rx   rD   r	   r,   rF   )r,   r   r  r   rC   r   r   s          r   _asarray_with_orderr    so     %B'EB24<KKU%@EMM%uEBE zz%  zz%u4zGGr.   c                     t        | |      \  }}t        |      r;t        j                  |       } |j                  t        j                  | d            S |j                  | d      S )zArray API compliant version of np.ravel.

    For non numpy namespaces, it just returns a flattened array, that might
    be or not be a copy.
    rB   C)r  ))r=   )rx   rD   r	   rF   ravelr   )r,   rC   r   s      r   _ravelr    sW     %B'EB2e$zz%++e3788::e5:))r.   c                     |j                   }|dv r| j                         j                         S |dk(  r| j                  j	                         S |dv r| j	                         S t        j
                  |       S )z*Convert X into a NumPy ndarray on the CPU.>   array_api_compat.torchr   r   >   array_api_compat.cupyr   )rA   r   r	   _arraygetrF   )r,   rC   xp_names      r   _convert_to_numpyr     si    kkG55yy{  ""	$	$||!!	5	5yy{==r.   c                     ddl m}  ||       }t        |       j                         D ]@  \  }}t	        |d      st        |t        j                        r ||      }t        |||       B |S )a  Create new estimator which converting all attributes that are arrays.

    The converter is called on all NumPy arrays and arrays that support the
    `DLPack interface <https://dmlc.github.io/dlpack/latest/>`__.

    Parameters
    ----------
    estimator : Estimator
        Estimator to convert

    converter : callable
        Callable that takes an array attribute and returns the converted array.

    Returns
    -------
    new_estimator : Estimator
        Convert estimator
    r   )clone
__dlpack__)	sklearn.baser  varsitemsr+   r(   r	   r)   setattr)	estimator	converterr  new_estimatorkey	attributes         r    _estimator_with_converted_arraysr*    sa    & #)$My///1Y9l+z)U]]/S!),IsI. 2 r.   c                 j    | t         j                  } t        j                  |       j                  dz  S )z6Return the absolute tolerance for a given numpy dtype.d   )r	   r   finfoeps)dtype_or_dtype_names    r   _atol_for_typer0  +  s/    " $mm;;*+//#55r.   c                 8    | j                  d      j                  S )aM  Return a platform-specific integer dtype suitable for indexing.

    On 32-bit platforms, this will typically return int32 and int64 otherwise.

    Note: using dtype is recommended for indexing transient array
    datastructures. For long-lived arrays, such as the fitted attributes of
    estimators, it is instead recommended to use platform-independent int32 if
    we do not expect to index more 2B elements. Using fixed dtypes simplifies
    the handling of serialized models, e.g. to deploy a model fit on a 64-bit
    platform to a target 32-bit platform such as WASM/pyodide.
    r   )rF   r   rB   s    r   indexing_dtyper2  5  s    * ::a=r.   c                 ~   | j                   dk(  sJ |j                  | |      }|S|j                  ||      }|j                  ||j                  d   df      }|j                  ||j                        |z  }|j                  d||j                        }|j                  |j                  | dk7  ||      |      S )zoA variant of `sklearn.utils.sparsefuncs.count_nonzero` for the Array API.

    It only supports 2D arrays.
    r   rw   r   r   )r   r   r   )	rH   r   rF   r   r=   r   r   r   r  )r   rC   r   r   sample_weightr   zero_scalars          r   _count_nonzeror6  M  s    
 66Q;;ll1Vl,G 

=
@

==3F3Fq3I12MN))G]%8%89MI**QvW]]*CK66"((167K8t6DDr.   )Tr   )NNTN)NN)NNN)/r   r   r;   	functoolsr   r	   scipy.specialr   _configr   fixesr   r   r   r   r&   r-   r6   r   r?   rD   rM   r[   rR   rp   r|   r~   r   r   r   r   r4   rx   r   r   r   r   r   r	  r  r  r  r  r*  r0  r2  r6  r   r.   r   <module>r;     s#   !         !#;< @!.H0 %)v (V 1
S	3D(:8 86F
l- l-^ /0  -1v $N (,3&T O-d 7;# &$!"!2?D"$ )-H48H<* :60Er.   