
    Mpj8L                     ^   S r 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r	SSKJr  SSKJr  S\R                   " S5      -  S:H  r\R$                  " 5       S;   r\" \R(                  5      r\" \R,                  5      r\" \R(                  5      r\" \R,                  5      r\R4                  R6                  \R4                  R8                  /r\R4                  R<                  \R4                  R>                  /r \R4                  RB                  \R4                  RD                  /r#\R4                  RH                  \R4                  RJ                  /r&\R4                  RN                  \R4                  RP                  /r)\R4                  RT                  \R4                  RV                  /r,\R4                  RZ                  \R4                  R\                  /r/ SS	K0J1r1  S
r2S r3S0S jr4\\" S5      :  r5\\" S5      :  r6\\" S5      :  a!  \R4                  Rn                  Rp                  r9OS r9\\" S5      :  a  S r:S r;OS r<S r=S r>S r:S r;\\" S5      :  a	  SSK?J@r@JArA  OSSKJ@r@JArA  S rBS rCS1S jrD\\" S5      :  a  SSKEJFrF  OSSKGJFrF  S  rHS! rIS" rJ\5(       d9  \R4                  R                  rL\R4                  R                  rNS#S$SSSSS%.S& jrOO!S2S\PSS'.S( jjrLSSSSS).S* jrNS#S$SSSSS%.S+ jrOS, rQ\R                  S-4S. jrS/ S/QrTg! \
 a    Sr	 GNf = f! \
 a    Sr2 GNNf = f)3zCompatibility fixes for older version of the dependencies

If you add content to this file, please give the version of the package
at which the fix is no longer needed.
    N)parse)_get_threadpool_controller   P    )wasm32wasm64)sparrayTFc                 
    X :g  $ N )Xs    O/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/sklearn/utils/fixes.py_object_dtype_isnanr   5   s	    6M    c                     [         R                  R                  XSS9n[        [	        S5      :  a  Uc  [
        R                  " U5      nU$ )NT)axiskeepdimsz1.10.999)scipystatsmode
sp_versionparse_versionnpravel)ar   r   s      r   _moder   :   sA    ;;A48D]:.. <88D>DKr   z1.12.0z1.15.0c                     SU;   a  UR                  S5      US'   SU;  a  SUS'   [        R                  R                  R                  " X40 UD6$ )Nrtoltolatollegacy)popr   sparselinalgcg)Abkwargss      r   _sparse_linalg_cgr*   S   sM    V"JJv.F5M%F6N||""%%a5f55r   z1.11.0c                     U R                  US9nU R                  US9nUb<  UR                  5       R                  5       nUR                  5       R                  5       nX#4$ N)r   )minmaxtoarrayr   r   r   the_minthe_maxs       r   _sparse_min_maxr3   `   s[    %%T%"%%T%"oo'--/Goo'--/Gr   c                     U R                  US9nU R                  US9nUb<  UR                  5       R                  5       nUR                  5       R                  5       nX#4$ r,   )nanminnanmaxr/   r   r0   s       r   _sparse_nan_min_maxr7   j   s[    (((%(((%oo'--/Goo'--/Gr   c                 8   [         R                  " [         R                  " U R                  5      5      n[	        U 5      " U R
                  U R                  U R                  4U R                  S9n UR                  U R
                  U R                  U   5      nX#4$ )N)shape)	r   flatnonzerodiffindptrtypedataindicesr9   reduceat)r   ufuncmajor_indexvalues       r   _minor_reducerD   w   sl    nnRWWQXX%67
 GQVVQYY1Aqvvqxx'<=!!r   c           	      ,   U R                   U   nUS:X  a  [        S5      eU R                   SU-
     nUS:X  a  U R                  5       OU R                  5       nUR	                  5         [        XR5      u  pg[        R                  " UR                  5      U   U:  nU" Xx   S5      Xx'   US:g  n	[        R                  " X5      n[        R                  " X5      nUS:X  aM  [        R                  R                  U[        R                  " [        U5      5      U44U R                  SU4S9n
OK[        R                  R                  Xv[        R                  " [        U5      5      44U R                  US4S9n
U
R!                  5       R#                  5       $ )Nr   &zero-size array to reduction operation   )dtyper9   )r9   
ValueErrortocsctocsrsum_duplicatesrD   r   r;   r<   compressr   r$   	coo_arrayzeroslenrH   r/   r   )r   r   
min_or_maxNMmatrB   rC   not_fullmaskress              r   _min_or_max_axisrX      sW   GGDM6EFFGGAH19aggi!'')*3;773::&{3a7$U_a8zkk$4D(19,,((#e*-{;<gg!f ) C ,,((bhhs5z&:;<gg!f ) C
 {{}""$$r   c                    Uc  SU R                   ;   a  [        S5      eU R                  R                  S5      nU R                  S:X  a  U$ UR                  U R                  R                  5       5      nU R                  [        R                  " U R                   5      :w  a  U" X45      nU$ US:  a  US-  nUS:X  d  US:X  a  [        XU5      $ [        S5      e)Nr   rF      rG   z.invalid axis, use 0 for rows, or 1 for columns)r9   rI   rH   r=   nnzreducer>   r   r   prodrX   )r   r   rQ   zeroms        r   _sparse_min_or_maxr`      s    <AGG| !IJJ77<<?Duuz!!!&&,,.1Auu((t'H!8AIDAI419#AZ88MNNr   c                 j    [        X[        R                  5      [        X[        R                  5      4$ r   )r`   r   minimummaximumr   r   s     r   r3   r3      s(    q

3q

3
 	
r   c                 j    [        X[        R                  5      [        X[        R                  5      4$ r   )r`   r   fminfmaxrd   s     r   r7   r7      s(    q0q0
 	
r   z1.25.0)ComplexWarningVisibleDeprecationWarningc                 2   [        U R                  5      R                  n[        U5      [        S5      :  a  UR                  [        R
                  S9nU$ [        U5      [        S5      :  a  0 OSS0n[        U5      [        S5      :  aK  U R                  " SS5         UR                  [        R
                  S9R                  " S	0 UD6nS S S 5        U$ UR                  [        R
                  S9R                  " S	0 UD6nU$ ! , (       d  f       U$ = f)
Nz2.2)rC   3copyFz3.0zfuture.no_silent_downcastingTr   )r   __version__base_versionfillnar   nanoption_contextinfer_objects)pdframe
pd_versioninfer_objects_kwargss       r   	pd_fillnarw      s    r~~.;;JZ =#77266* L  
+}S/AABPU 	 $}U';;""#A4H2662@@XCWX I L LLrvvL.<<T?STEL	 IH Ls    .D
Dc                    US:X  a  US;   a  US:X  a  [        U R                  U R                  4[        U R                  U R
                  S   5      SS9nU R                  R                  USS9U l        U R                  R                  USS9U l        g
[        [        U R
                  5      S	9nU R                  R                  USS9U l        U R                  R                  USS9U l        g
g
g
)aY  Preserve indices dtype for SciPy < 1.12 when converting from DIA to CSR/CSC.

For SciPy < 1.12, DIA arrays indices are upcasted to `np.int64` that is
inconsistent with DIA matrices. We downcast the indices dtype to `np.int32` to
be consistent with DIA matrices.

The converted indices arrays are affected back inplace to the sparse container.

Parameters
----------
sparse_container : sparse container
    Sparse container to be checked.
requested_sparse_format : str or bool
    The type of format of `sparse_container`.

Notes
-----
See https://github.com/scipy/scipy/issues/19245 for more details.
	dia_array)csrcoorz   rG   T)arraysmaxvalcheck_contentsFrl   )r}   N)	 _smallest_admissible_index_dtyper<   r?   r.   r[   r9   astyperowcol)sparse_containeroriginal_container_formatrequested_sparse_formatindex_dtypes       r   _preserve_dia_indices_dtyper      s   , !K/4K P 5 #e+:(//1A1I1IJ+//1A1G1G1JK#K
 (8'?'?'F'F% (G ($ '7&=&=&D&D% 'E '# ;+112K $4#7#7#>#>{QV#>#W #3#7#7#>#>{QV#>#W +5/r   c                 x   [         R                  " [         R                  " [         R                  5      R                  5      n[         R                  " [         R                  " [         R                  5      R                  5      nUbV  U[         R                  " [         R
                  5      R                  :  a  [        SU S35      eX:  a  [         R
                  $ [        U [         R                  5      (       a  U 4n U  GH%  n[        U[         R                  5      (       d  [        S[        U5       S35      e[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " UR                  [         R                  5      (       a  M  U(       d  [         R
                  s  $ UR                  S:X  a  M  UR	                  5       nUR                  5       nXc:  d  X:  d  GM  [         R
                  s  $    [         R                  $ )a1  Based on input (integer) arrays `a`, determine a suitable index data
type that can hold the data in the arrays.

This function returns `np.int64` if it either required by `maxval` or based on the
largest precision of the dtype of the arrays passed as argument, or by their
contents (when `check_contents is True`). If none of the condition requires
`np.int64` then this function returns `np.int32`.

Parameters
----------
arrays : ndarray or tuple of ndarrays, default=()
    Input arrays whose types/contents to check.

maxval : float, default=None
    Maximum value needed.

check_contents : bool, default=False
    Whether to check the values in the arrays and not just their types.
    By default, check only the types.

Returns
-------
dtype : {np.int32, np.int64}
    Suitable index data type (int32 or int64).
zmaxval=z+ is to large to be represented as np.int64.z)Arrays should be of type np.ndarray, got z	 instead.zArray dtype z= is not supported for index dtype. We expect integral values.r   )r   int32iinfor-   r.   int64rI   
isinstancendarray	TypeErrorr=   
issubdtyperH   integercan_castsize)r|   r}   r~   int32minint32maxarrminvals          r   r   r     s   6 xx*../Hxx*../HBHHRXX&***&!LM  88O&"**%%#rzz**;DI;iP  }}SYY

33syyk *# #  {{399bhh//! xxxx1}$(988O/ 2 88Or   z1.12)	laplacianc                 h     U R                  USS9  g ! [         a    U R                  U5         g f = f)Nr>   )filter)
extractallr   )tarfilepaths     r   tarfile_extractallr   W  s9    ! 	4/ !4 !s    11c                  <   SSK n SSKn[        5       R                  5       n[	        S U 5       5      nU(       d  g[        S5      nU HQ  nUS   S:w  a  M  UR                  S5      nUR                  S	5      nUb  Uc    g
US:X  d  M@  [        U5      U:  d  MQ    g
   g)z8Return True if in an unstable configuration for OpenBLASr   Nc              3   0   #    U  H  oS    S:H  v   M     g7f)internal_apiopenblasNr   ).0infos     r   	<genexpr>6_in_unstable_openblas_configuration.<locals>.<genexpr>j  s     Un-;s   Fz0.3.16r   r   versionarchitectureT
neoversen1)numpyr   r   r   anyr   get)r   r   modules_infoopen_blas_usedopenblas_arm64_stable_versionr   openblas_versionopenblas_architectures           r   #_in_unstable_openblas_configurationr   a  s     -/446LUUUN %2($;!:-88I. $ 8#'<'D!\1./2OO   r   c                 2    [         [        S5      :  a  0 $ X0$ )Nz1.15)r   r   )keyrC   s     r   "_get_additional_lbfgs_options_dictr     s    }V442F3,Fr   g{Gz?r{   )densityformatrH   random_staterngdata_samplerc          	      r    [         R                  R                  U UUUU=(       d    UUS9n[        U5        U$ )N)r   r   rH   r   r   )r   r$   random_array_ensure_sparse_index_int32)r9   r   r   rH   r   r   r   r   s           r   _sparse_random_arrayr     sC     LL%%,% & 
 	#1%r   )krH   r   c                    [         R                  R                  XX#S9n[         R                  R                  U5      R	                  U5      $ )N)r   rH   )r   r$   eyery   asformat)r_   nr   rH   r   r'   s         r   _sparse_eye_arrayr     s;    LLQQ4||%%a(11&99r   )offsetsr9   r   rH   c                   [         R                  R                  XX$S9n[         R                  R                  U5      R	                  U5      $ )N)r   r9   rH   )r   r$   diagsry   r   )	diagonalsr   r9   r   rH   r'   s         r   _sparse_diags_arrayr     s=     LLyT||%%a(11&99r   c                    [         R                  R                  " U UUU=(       d    UUS.6n[         R                  R                  U5      R	                  U5      $ )N)r   rH   r   data_rvs)r   r$   randomrN   r   )r9   r   r   rH   r   r   r   r'   s           r   r   r     sN     LL,!
 ||%%a(11&99r   c                 r   U R                   S;   a  [        U 5      u  U l        U l        gU R                   S:X  a]  [	        U S5      (       a  [        U 5      U l        g[	        U S5      (       a  [        U 5      U l        g[        U 5      u  U l        U l        gU R                   S:X  a  [        U 5      U l        gg)z*Safely ensure that index arrays are int32.)cscrz   bsrr{   coordsr?   diaN)	r   _safely_cast_index_arraysr?   r<   hasattrr   r   r   r   )r'   s    r   r   r     s    xx((7:	18	
U	1h03AHQ	""1!4AI4Q7LAE15	
U	-a0	 
r    c                 <  ^^	 [         R                  " T5      R                  m	U R                  S;   a  U R                  S   T	:  a  [        SU 35      e[        U R                  6 T	:  a0  U R                  T	:  R                  5       (       a  [        SU 35      eU R                  R                  TSS9nU R                  R                  TSS9nX44$ U R                  S:X  a  [        U SS	5      nUc(  [        U S
S	5      nUc  U R                  U R                  4n[        U R                  6 T	:  a(  [        U	4S jU 5       5      (       a  [        SU 35      e[        U4S jU 5       5      $ U R                  S:X  ab  [        U R                  6 T	:  a0  U R                  T	:  R                  5       (       a  [        SU 35      eU R                  R                  TSS9nU$ U R                  S:X  a  U R                  u  pxU R                  S   U-  T	:  a  [        S5      e[        U R                  6 T	:  a3  U R                  U-  T	:  R                  5       (       a  [        SU 35      eU R                  R                  TSS9nU R                  R                  TSS9nX44$ g	)a  Safely cast sparse array indices to `idx_dtype`.

Check the shape of `A` to determine if it is safe to cast its index
arrays to dtype `idx_dtype`. If any dimension in shape is larger than
fits in the dtype, casting is unsafe so raise ``ValueError``.
If safe, cast the index arrays to `idx_dtype` and return the result
without changing the input `A`. The caller can assign results to `A`
attributes if desired or use the recast index arrays directly.

Unless downcasting is needed, the original index arrays are returned.
You can test e.g. ``A.indptr is new_indptr`` to see if downcasting occurred.

See SciPy: scipy.sparse._sputils.py for more info on safely_cast_index_arrays()
)r   rz   zindptr values too large for zindices values too large for Fr   r{   r   Nr?   c              3   H   >#    U  H  oT:  R                  5       v   M     g 7fr   )r   )r   co	max_values     r   r   ,_safely_cast_index_arrays.<locals>.<genexpr>  s     ;FbN''))Fs   "zcoords values too large for c              3   B   >#    U  H  oR                  TS S9v   M     g7f)Fr   N)r   )r   r   	idx_dtypes     r   r   r      s     G"YYyuY5s   r   zoffsets values too large for r   z!indptr values too large for {msg})r   r   r.   r   r<   rI   r9   r?   r   r   getattrr   r   tupler   	blocksize)
r'   r   msgr?   r<   r   r   RCr   s
    `       @r   r   r     sZ    #''Ixx>!88B<)#;C5ABB=9$		I%**,, #@!FGG))""95"97	
U	Hd+>Q	40F~%%=9$;F;;; #?u!EFFGGGG	
U	=9$		I%**,, #@!FGG))""95"9	
U	{{88B<!i'@AA=9$		A	)..00 #@!FGG))""95"97 
r   )
z#3f90daz#ffa90ez#bd1f01z#94a4a2z#832db6z#a96b59z#e76300z#b9ac70z#717581z#92dadd)r   )r   NFr   )U__doc__platformstructr   r   r   scipy.sparse.linalgscipy.statspandasrs   ImportError$sklearn.externals._packaging.versionr   r   sklearn.utils.parallelr   calcsize	_IS_32BITmachine_IS_WASMrm   
np_versionrn   np_base_versionr   sp_base_versionr$   
csr_matrix	csr_arrayCSR_CONTAINERS
csc_matrix	csc_arrayCSC_CONTAINERS
coo_matrixrN   COO_CONTAINERS
lil_matrix	lil_arrayLIL_CONTAINERS
dok_matrix	dok_arrayDOK_CONTAINERS
bsr_matrix	bsr_arrayBSR_CONTAINERS
dia_matrixry   DIA_CONTAINERSscipy.sparser
   SPARRAY_PRESENTr   r   SCIPY_VERSION_BELOW_1_12SCIPY_VERSION_BELOW_1_15r%   r&   r*   r3   r7   rD   rX   r`   numpy.exceptionsrh   ri   rw   r   r   'sklearn.externals._scipy.sparse.csgraphr   scipy.sparse.csgraphr   r   r   	eye_arrayr   diags_arrayr   r   floatr   r   r   PETROFF_COLORSr   r   r   <module>r     s         H =$$*	!552>>*

 7 785,,-

 7 78 ,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB$O

 +]8-DD 
 +]8-DD  mH--++..6 mH--  "%8O$

 x((JJ"+X^BL f%%A!NG  ..,,22
 .:!5 :
 "#$t4: :,1" ,.88 8|I  	B:  Os#   L L  LL L,+L,