
    3;jiY7                     p   d Z ddlZddlZddlZddlZddlZddlZ	 ddlZ	n# e
$ r dZ	Y nw xY wddlmZ ddlmZ d ej        d          z  dk    Z ej                    dv Z eej                  Z eej                  Z eej                  Z eej                  Zej        j        ej        j        gZej        j        ej        j        gZ ej        j!        ej        j"        gZ#ej        j$        ej        j%        gZ&ej        j'        ej        j(        gZ)ej        j*        ej        j+        gZ,ej        j-        ej        j.        gZ/	 dd	l0m1Z1 d
Z2n# e
$ r dZ2Y nw xY wd Z3d$dZ4e ed          k    rej        j5        j6        Z7nd Z7e ed          k    rd Z8d Z9nd Z:d Z;d Z<d Z8d Z9e ed          k    r	ddl=m>Z>m?Z? nddlm>Z>m?Z? d Z@d ZAd%dZBe ed          k     rddlCmDZD nddlEmDZD d  ZFd! ZGd" ZHdZI	 ddlJZJ eeJj                  ZKeK ed#          k     rd
ZIdS dS # eL$ r Y dS w xY w)&zCompatibility fixes for older version of python, numpy and scipy

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                     | | k    S N )Xs    M/root/voice-cloning/.venv/lib/python3.11/site-packages/sklearn/utils/fixes.py_object_dtype_isnanr   5   s    6M    c                     t           j                            | |d          }t          t	          d          k    r|t          j        |          }|S )NT)axiskeepdimsz1.10.999)scipystatsmode
sp_versionparse_versionnpravel)ar   r   s      r   _moder   :   sJ    ;AD488D]:.... <8D>>DKr   z1.12.0c                     d|v r|                     d          |d<   d|vrd|d<   t          j        j        j        | |fi |S )Nrtoltolatollegacy)popr   sparselinalgcg)Abkwargss      r   _sparse_linalg_cgr*   I   sV    V"JJv..F5M%F6N|"%a55f555r   z1.11.0c                     |                      |          }|                     |          }|L|                                                                }|                                                                }||fS N)r   )minmaxtoarrayr   r   r   the_minthe_maxs       r   _sparse_min_maxr3   V   so    %%T%""%%T%""oo''--//Goo''--//Gr   c                     |                      |          }|                     |          }|L|                                                                }|                                                                }||fS r,   )nanminnanmaxr/   r   r0   s       r   _sparse_nan_min_maxr7   `   so    (((%%(((%%oo''--//Goo''--//Gr   c                    t          j        t          j        | j                            } t	          |           | j        | j        | j        f| j                  } |                    | j        | j        |                   }||fS )N)shape)	r   flatnonzerodiffindptrtypedataindicesr9   reduceat)r   ufuncmajor_indexvalues       r   _minor_reducerD   m   so    nRWQX%6%677
 DGGQVQY1AAAqvqx'<==E!!r   c           	      j   | j         |         }|dk    rt          d          | j         d|z
           }|dk    r|                                 n|                                 }|                                 t          ||          \  }}t          j        |j                  |         |k     } |||         d          ||<   |dk    }	t          j	        |	|          }t          j	        |	|          }|dk    rMt          j                            |t          j        t          |                    |ff| j        d|f          }
nLt          j                            ||t          j        t          |                    ff| j        |df          }
|
                                                                S )Nr   &zero-size array to reduction operation   )dtyper9   )r9   
ValueErrortocsctocsrsum_duplicatesrD   r   r;   r<   compressr   r$   
coo_matrixzeroslenrH   r/   r   )r   r   
min_or_maxNMmatrB   rC   not_fullmaskress              r   _min_or_max_axisrX   w   s   GDM66EFFFGAH199aggiii!''))*3
;;U73:&&{3a7$*U8_a88hzk$44D%((199,))#e**--{;<g!f *  CC ,))bhs5zz&:&:;<g!f *  C
 {{}}""$$$r   c                    |d| j         v rt          d          | j                            d          }| j        dk    r|S |                    | j                                                  }| j        t          j	        | j                   k    r |||          }|S |dk     r|dz  }|dk    s|dk    rt          | ||          S t          d          )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    <AG|| !IJJJ7<<??Duzz!!!&,,..11Au((((JtQ''H!88AIDAII4199#AtZ888MNNNr   c                 n    t          | |t          j                  t          | |t          j                  fS r   )r`   r   minimummaximumr   r   s     r   r3   r3      s.    q$
33q$
33
 	
r   c                 n    t          | |t          j                  t          | |t          j                  fS r   )r`   r   fminfmaxrd   s     r   r7   r7      s.    q$00q$00
 	
r   z1.25.0)ComplexWarningVisibleDeprecationWarningc                 F   t          | j                  j        }t          |          t          d          k     r!|                    t          j                  }nt          |          t          d          k    ri nddi}t          |          t          d          k     rU | j        dd          5   |                    t          j                  j        d	i |}d d d            n# 1 swxY w Y   n+ |                    t          j                  j        d	i |}|S )
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      sf   r~..;JZ  =#7#77726**  
++}S/A/AAABBPU 	 $$}U';';;;""#A4HH Y Y@2622@XXCWXXY Y Y Y Y Y Y Y Y Y Y Y Y Y Y =ELLrvL..<TT?STTELs   2,C**C.1C.c                    |dk    r|dv r|dk    rt          | j        | j        ft          | j        | j        d                   d          }| j                            |d          | _        | j                            |d          | _        d
S t          t          | j                  	          }| j                            |d          | _        | j                            |d          | _        d
S d
S d
S )a  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      sF   , !K//4K P 5 5 #e++:(/1A1IJ+/1A1G1JKK#  K
 (8'?'F'F% (G ( ($ '7&=&D&D% 'E ' '### ;+122  K $4#7#>#>{QV#>#W#W #3#7#>#>{QV#>#W#W   + 0/ 5 5r   r   c                    t          j        t          j        t           j                  j                  }t          j        t          j        t           j                  j                  }|L|t          j        t           j                  j        k    rt          d| d          ||k    rt           j        S t          | t           j                  r| f} | D ]}t          |t           j                  s t          dt          |           d          t          j        |j        t           j                  st          d|j         d          t          j        |j        t           j                  s^|st           j        c S |j        dk    r|                                }|                                }||k     s||k    rt           j        c S t           j        S )	a}  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).
    Nz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 x**.//Hx**.//HBHRX&&***M&MMM   H8O&"*%%  $ $#rz** 	PDIIPPP   }SY
33 	#sy # # #   {39bh// 	$!   xx1}}H$$(9(98OOO8Or   z1.12)	laplacianc                     	 |                      |d           d S # t          $ r |                      |           Y d S w xY w)Nr>   )filter)
extractallr   )tarfilepaths     r   tarfile_extractallr   M  s`    ! 	4///// ! ! !4      !s    >>c                  l   ddl } ddl}t                                                      }t	          d |D                       }|sdS t          d          }|D ]\}|d         dk    r|                    d          }|                    d	          }|| d
S |dk    rt          |          |k     r d
S ]dS )z8Return True if in an unstable configuration for OpenBLASr   Nc              3   .   K   | ]}|d          dk    V  dS )internal_apiopenblasNr   ).0infos     r   	<genexpr>z6_in_unstable_openblas_configuration.<locals>.<genexpr>`  s,      UUn-;UUUUUUr   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   W  s     LLLLLL-//4466LUUUUUUUN u %2($;$;!  :--88I.. $ 8 8#'<'D44!\11.//2OOO 445r   c                 >    t           t          d          k    ri n| |iS )Nz1.15)r   r   )keyrC   s     r   "_get_additional_lbfgs_options_dictr   ~  s"    }V4444223,Fr   z17.0.0)r   )r   NF)M__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_CONTAINERSrN   	coo_array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   r%   r&   r*   r3   r7   rD   rX   r`   numpy.exceptionsrh   ri   rw   r   r   'sklearn.externals._scipy.sparse.csgraphr   scipy.sparse.csgraphr   r   r   PYARROW_VERSION_BELOW_17pyarrowpyarrow_versionModuleNotFoundErrorr   r   r   <module>r      s\                     	BBB H G G G G G = = = = = =$$$*	8!55]2>**
-
 788]5,--
-
 788 ,)5<+AB,)5<+AB,)5<+AB,)5<+AB,)5<+AB,)5<+AB,)5<+AB$$$$$$OO   OOO  
    mmH----+.6 6 6 mmH----            " " "% % %8O O O$
 
 

 
 
 x((((JJJJJJJJJ         "+X +X +X^B B B BL f%%%%AAAAAAA     ! ! !  NG G G
 ! 	NNN#mG$788Ox0000#'    10 	 	 	DD	s0   ! ++E EE%H, ,H54H5