CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
fixes.cpython-310.pyc131 linesDownload Raw Back to __pycache__
1o

2�Yi=�@s�dZddlZddlZddlZddlZddlZddlZddlmZzddl	Z3Wney1dZ4Ynwddlm
ZddlmZde�d	�d5kZe��dvZeej�Zeej�Zeej�Zeej�ZejjejjgZejjejj gZ!ejj"ejj#gZ$ejj%ejj&gZ'ejj(ejj)gZ*ejj+ejj,gZ-ejj.ejj/gZ0z6ddl1m2Z2d
Z3Wney�dZ3Ynwdd�Z4d7dd�Z5eed�kr�ejj6j7Z8ndd�Z8dd�Z9eed�kr�dd�Z:dd�Z;ndd�Z<dd �Z=d!d"�Z>d#d�Z:d$d�Z;eed%�kr�dd&l?m@Z@mAZAndd&lm@Z@mAZAd'd(�ZBd)d*�ZCd8d,d-�ZDeed.�k�r!dd/lEmFZFndd/lGmFZFd0d1�ZHd2d3�ZId4d5�ZJdZKzddlLZLeeLj�ZMeMed6�k�rKd
ZKWdSWdSeN�yXYdSw)9z�Compatibility fixes for older version of python, numpy and scipy7 8If you add content to this file, please give the version of the package9at which the fix is no longer needed.10�N)�optimize�)�parse�)�_get_threadpool_controller��P� )Zwasm32Zwasm64)�sparrayTFcCs||kS�N�)�Xrr�}E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\sklearn/utils/fixes.py�_object_dtype_isnan6srcCsPttd�kr tjj||dd�}ttd�kr|durt�|�}|Stjj||d�S)N�1.9.0T)�axisZkeepdimsz1.10.999�r)�11sp_version�
parse_version�scipy�stats�mode�np�ravel)�arrrrr�_mode;s12rz1.12.0cKs>d|vr|�d�|d<d|vrd|d<tjjj||fi|��S)NZrtolZtolZatol�legacy)�popr�sparse�linalg�cg)�A�b�kwargsrrr�_sparse_linalg_cgLs13r$cCs6d}tt|�krtj|dd�Stjj|dd�\}}|S)a�Estimate the optimal Yeo-Johnson transformation parameter (lambda).14 15    This function provides a compatibility workaround for versions of SciPy16    older than 1.9.0, where `scipy.stats.yeojohnson` did not return17    the estimated lambda directly.18 19    Parameters20    ----------21    _neg_log_likelihood : callable22        A function that computes the negative log-likelihood of the Yeo-Johnson23        transformation for a given lambda. Used only for SciPy versions < 1.9.0.24 25    x : array-like26        Input data to estimate the Yeo-Johnson transformation parameter.27 28    Returns29    -------30    lmbda : float31        The estimated lambda parameter for the Yeo-Johnson transformation.32    r)�����r)ZbrackN)�lmbda)rrrZbrentrrZ33yeojohnson)Z_neg_log_likelihood�xZmin_scipy_version�_r&rrr�_yeojohnson_lambdaUs34r)z1.11.0cC�@|j|d�}|j|d�}|dur|����}|����}||fS�Nr)�min�max�toarrayr�r
rZthe_minZthe_maxrrr�_sparse_min_maxy�r0cCr*r+)ZnanminZnanmaxr.rr/rrr�_sparse_nan_min_max�r1r2cCsLt�t�|j��}t|�|j|j|jf|jd�}|�|j|j|�}||fS)N)�shape)	rZflatnonzero�diff�indptr�type�data�indicesr3Zreduceat)r
Zufunc�major_index�valuerrr�
_minor_reduce�sr;cCs|j|}|dkr
td��|jd|}|dkr|��n|��}|��t||�\}}t�|j�||k}|||d�||<|dk}	t�	|	|�}t�	|	|�}|dkrht35jj|t�
t|��|ff|jd|fd�}36nt37jj||t�
t|��ff|j|dfd�}38|39����S)Nr�&zero-size array to reduction operationr)�dtyper3)r3�40ValueErrorZtocscZtocsrZsum_duplicatesr;rr4r5�compressrr�41coo_matrixZzeros�lenr=r.r)r
r�42min_or_max�N�MZmatr9r:�not_full�mask�resrrr�_min_or_max_axis�s043��rHcCs�|dur2d|jvr
td��|j�d�}|jdkr|S|�|j���}|jt�	|j�kr0|||�}|S|dkr:|d7}|dksB|dkrHt44|||�Std��)Nrr<rrz.invalid axis, use 0 for rows, or 1 for columns)r3r>r=r6�nnz�reducer7rr�prodrH)r
rrB�zero�mrrr�_sparse_min_or_max�s454647rNcC�t||tj�t||tj�fSr)rNr�minimum�maximum�r
rrrrr0���cCrOr)rNrZfminZfmaxrRrrrr2�rSz1.25.0)�ComplexWarning�VisibleDeprecationWarningcCs�t|j�j}t|�td�kr|jtjd�}|St|�td�kr!inddi}|�dd��|jtjd�jdi|��}Wd�|S1sDwY|S)	Nz2.2)r:�3�copyFzfuture.no_silent_downcastingTr)r�__version__�base_versionZfillnar�nanZoption_contextZ
infer_objects)�pd�frameZ48pd_versionZinfer_objects_kwargsrrr�	pd_fillna�s��49��r]cCs�|dkrN|dvrP|dkr2t|j|jft|j|jd�dd�}|jj|dd�|_|jj|dd�|_d50Stt|j�d	�}|jj|dd�|_|jj|dd�|_d51Sd52Sd53S)a�Preserve indices dtype for SciPy < 1.12 when converting from DIA to CSR/CSC.54 55    For SciPy < 1.12, DIA arrays indices are upcasted to `np.int64` that is56    inconsistent with DIA matrices. We downcast the indices dtype to `np.int32` to57    be consistent with DIA matrices.58 59    The converted indices arrays are affected back inplace to the sparse container.60 61    Parameters62    ----------63    sparse_container : sparse container64        Sparse container to be checked.65    requested_sparse_format : str or bool66        The type of format of `sparse_container`.67 68    Notes69    -----70    See https://github.com/scipy/scipy/issues/19245 for more details.71    �	dia_array)�csrZcoor_rT)�arrays�maxval�check_contentsF)rW)raN)	� _smallest_admissible_index_dtyper5r8r-rIr3Zastype�row�col)Zsparse_containerZoriginal_container_formatZrequested_sparse_formatZindex_dtyperrr�_preserve_dia_indices_dtype�s&72�����rfrcCst�t�tj�j�}t�t�tj�j�}|dur0|t�tj�jkr)td|�d���||kr0tjSt|tj�r9|f}|D]M}t|tj�sMt	dt73|��d���t�|jtj
�s^td|j�d���t�|jtj�s�|smtjS|jdkrsq;|��}|��}||ks�||kr�tjSq;tjS)	a}Based on input (integer) arrays `a`, determine a suitable index data74    type that can hold the data in the arrays.75 76    This function returns `np.int64` if it either required by `maxval` or based on the77    largest precision of the dtype of the arrays passed as argument, or by their78    contents (when `check_contents is True`). If none of the condition requires79    `np.int64` then this function returns `np.int32`.80 81    Parameters82    ----------83    arrays : ndarray or tuple of ndarrays, default=()84        Input arrays whose types/contents to check.85 86    maxval : float, default=None87        Maximum value needed.88 89    check_contents : bool, default=False90        Whether to check the values in the arrays and not just their types.91        By default, check only the types.92 93    Returns94    -------95    dtype : {np.int32, np.int64}96        Suitable index data type (int32 or int64).97    Nzmaxval=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)rZint32Ziinfor,r-Zint64r>�98isinstanceZndarray�	TypeErrorr6Z99issubdtyper=�integerZcan_cast�size)r`rarbZint32minZint32maxZarr�minvalrrrrcs>100���101102103�rcz1.12)�	laplaciancCs4z104|j|dd�WdSty|�|�YdSw)Nr7)�filter)�105extractallrh)�tarfile�pathrrr�tarfile_extractallms106�rqcCs�ddl}ddl}t���}tdd�|D��}|sdStd�}|D]+}|ddkr)q |�d	�}|�d107�}|dus;|dur>dS|dkrKt|�|krKdSq dS)
z8Return True if in an unstable configuration for OpenBLASrNcss�|]	}|ddkVqdS)�internal_api�openblasNr)�.0�inforrr�	<genexpr>�s�z6_in_unstable_openblas_configuration.<locals>.<genexpr>Fz0.3.16rrrs�version�architectureTZ108neoversen1)�numpyrrru�anyr�get)ryrZmodules_infoZopen_blas_usedZopenblas_arm64_stable_versionruZopenblas_versionZopenblas_architecturerrr�#_in_unstable_openblas_configurationws&109110111�r|cCsttd�kriS||iS)Nz1.15)rr)�keyr:rrr�"_get_additional_lbfgs_options_dict�sr~z17.0.0)r)rNF)O�__doc__�platform�structryrrZscipy.sparse.linalgZscipy.statsrZpandasr[�ImportErrorZexternals._packaging.versionrrZparallelr�calcsizeZ	_IS_32BIT�machineZ_IS_WASMrXZ112np_versionrYZnp_base_versionrZsp_base_versionrZ113csr_matrixZ	csr_arrayZCSR_CONTAINERSZ114csc_matrixZ	csc_arrayZCSC_CONTAINERSr@Z	coo_arrayZCOO_CONTAINERSZ115lil_matrixZ	lil_arrayZLIL_CONTAINERSZ116dok_matrixZ	dok_arrayZDOK_CONTAINERSZ117bsr_matrixZ	bsr_arrayZBSR_CONTAINERSZ118dia_matrixr^ZDIA_CONTAINERSZscipy.sparser119ZSPARRAY_PRESENTrrrr r$r)r0r2r;rHrNZnumpy.exceptionsrTrUr]rfrcZexternals._scipy.sparse.csgraphrlZscipy.sparse.csgraphrqr|r~ZPYARROW_VERSION_BELOW_17ZpyarrowZpyarrow_version�ModuleNotFoundErrorrrrr�<module>s�	�120121122123�124
	"125 126
127	128/F129'130131��
Aluode/PerceptionLabPortable · CoolFace