� I�gx<��N�dZddlZddlZddlZddlZddlZddlZddlZ ddl Z n #e $rdZ YnwxYwddl m ZddlmZdejd��zd kZej��d vZeej��Zeej��Zeej��Zeej��ZejjgZejjgZejj gZ!ejj"gZ#ejj$gZ%ejj&gZ'ejj(gZ)eej��ed ��kr�e�*ejj+��e�*ejj,��e!�*ejj-��e#�*ejj.��e%�*ejj/��e'�*ejj0��e)�*ejj1�� dd l2m3Z3d Z4n #e $rdZ4YnwxYw ddl2m+Z+d Z5n #e $rdZ5YnwxYw ddl6m7Z7m8Z8n#e $r ddl9m8Z8m7Z7YnwxYwd�Z:dd�d�Z;eed��kre;Z<nddlm<Z<d1d�Z=eed��krejj>j?Z@nd�Z@eed��krd�ZAd�ZBnd�ZCd�ZDd �ZEd!�ZAd"�ZBeed#��kr dd$lFmGZGmHZHndd$lmGZGmHZHd%�ZId&�ZJd2d(�ZKeed)��krdd*lLmMZMndd*lNmMZMd+�ZOd,�ZPe �!ee j��ed-��krd.�ZQnd/�ZQd0�ZRdS)3z�Compatibility 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�wasm64z1.8)�sparrayTF)� csr_array)�line_search_wolfe1�line_search_wolfe2)rrc��||kS�N�)�Xs �c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sklearn/utils/fixes.py�_object_dtype_isnanrSs �� ��6�M��linear)�methodc �,�tj||fd|i|��S)N� interpolation)�np� percentile)�a�qr�kwargss r� _percentiler Ys!�� �=��A� >� >�V� >�v� >� >�>rz1.22)rc��ttd��krRtj�||d���}ttd��kr|�t j|��}|Stj�||���S)Nz1.9.0T)�axis�keepdimsz1.10.999�r")� sp_version� parse_version�scipy�stats�moder�ravel)rr"r)s r�_moder+dsx���]�7�+�+�+�+��{�����t��<�<�� ��z�2�2� 2� 2��|��x��~�~��� � �;� � �A�D� � )� )�)rz1.12.0c ��d|vr|�d��|d<d|vrd|d<tjjj||fi|��S)N�rtol�tol�atol�legacy)�popr'�sparse�linalg�cg)�A�brs r�_sparse_linalg_cgr7usV�� �V� � �"�J�J�v�.�.�F�5�M� �� � �%�F�6�N��|�"�%�a��5�5�f�5�5�5rz1.11.0c���|�|���}|�|���}|�L|������}|������}||fS�Nr$)�min�max�toarrayr*�rr"�the_min�the_maxs r�_sparse_min_maxr@�so���%�%�T�%�"�"���%�%�T�%�"�"�� � ��o�o�'�'�-�-�/�/�G��o�o�'�'�-�-�/�/�G����rc���|�|���}|�|���}|�L|������}|������}||fSr9)�nanmin�nanmaxr<r*r=s r�_sparse_nan_min_maxrD�so���(�(��(�%�%���(�(��(�%�%�� � ��o�o�'�'�-�-�/�/�G��o�o�'�'�-�-�/�/�G����rc��tjtj|j����}t |��|j|j|jf|j���}|�|j|j|��}||fS)N)�shape) r� flatnonzero�diff�indptr�type�data�indicesrF�reduceat)r�ufunc� major_index�values r� _minor_reducerQ�so���n�R�W�Q�X�%6�%6�7�7� � �D��G�G�Q�V�Q�Y���1��� A� A� A�����q�v�q�x� �'<�=�=���E�!�!rc �P�|j|}|dkrtd���|jd|z }|dkr|���n|���}|���t ||��\}}t j|j��||k}|||d��||<|dk} t j | |��}t j | |��}|dkrMtj � |t j t|����|ff|jd|f���} nLtj � ||t j t|����ff|j|df���} | j���S)Nr�&zero-size array to reduction operationr)�dtyperF)rF� ValueError�tocsc�tocsr�sum_duplicatesrQrrHrI�compressr'r2� coo_matrix�zeros�lenrTr5r*) rr"� min_or_max�N�M�matrOrP�not_full�mask�ress r�_min_or_max_axisrd�s��� �G�D�M�� ��6�6��E�F�F� F� �G�A��H� ���1�9�9�a�g�g�i�i�i�!�'�'�)�)�� ������*�3� �;�;�� �U��7�3�:�&�&�{�3�a�7��$�*�U�8�_�a�8�8��h����z���k�$� �4�4� �� �D�%�(�(�� �1�9�9��,�)�)����#�e�*�*�-�-�{�;�<��g��!�f�*���C�C� �,�)�)���b�h�s�5�z�z�&:�&:�;�<��g��!�f�*���C� �u�{�{�}�}�rc��|��d|jvrtd���|j�d��}|jdkr|S|�|j�����}|jtj |j��kr |||��}|S|dkr|dz }|dks|dkrt|||��Std���)NrrSrrz.invalid axis, use 0 for rows, or 1 for columns) rFrUrTrJ�nnz�reducerKr*r�prodrd)rr"r]�zero�ms r�_sparse_min_or_maxrk�s��� �<��A�G�|�|� �!I�J�J�J��7�<�<��?�?�D��u��z�z�� ��!�!�!�&�,�,�.�.�1�1�A��u�����(�(�(�(��J�t�Q�'�'���H� �!�8�8� �A�I�D� �A�I�I�4�1�9�9�#�A�t�Z�8�8� 8��M�N�N� Nrc�n�t||tj��t||tj��fSr)rkr�minimum�maximum�rr"s rr@r@�s.�� �q�$�� � 3� 3� �q�$�� � 3� 3� � rc�n�t||tj��t||tj��fSr)rkr�fmin�fmaxros rrDrD�s.�� �q�$��� 0� 0� �q�$��� 0� 0� � rz1.25.0)�ComplexWarning�VisibleDeprecationWarningc��t|j��j}t|��td��kr!|�tj���}nzt|��td��krinddi}|jdd��5|�tj���jdi|��}ddd��n #1swxYwY|S) Nz2.2)rP�3�copyFzfuture.no_silent_downcastingTr)r&� __version__� base_version�fillnar�nan�option_context� infer_objects)�pd�frame� pd_version�infer_objects_kwargss r� pd_fillnar��s���r�~�.�.�;�J��Z� � �=��#7�#7�7�7�� � �2�6� �*�*��� � �+�+�}�S�/A�/A�A�A�B�B��PU�� ��R� �=�t� D� D� U� U�<�E�L�L�r�v�L�.�.�<�T�T�?S�T�T�E� U� U� U� U� U� U� U� U� U� U� U���� U� U� U� U� �Ls�,C � C�Cc���|dkr�|dvr�|dkr�t|j|jft|j|jd��d���}|j�|d���|_|j�|d���|_d Stt|j��� ��}|j�|d���|_|j�|d���|_d Sd Sd 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�coor�rT)�arrays�maxval�check_contentsF)rw)r�N) � _smallest_admissible_index_dtyperIrLr;rfrF�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� +� +�:�(�/�1A�1I�J��+�/�1A�1G��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�5rrc��tjtjtj��j��}tjtjtj��j��}|�L|tjtj��jkrt d|�d����||kr tjSt|tj��r|f}|D]�}t|tj��s tdt|���d����tj |j tj ��st d|j �d����tj|j tj��s^|stjcS|jdkr��|���}|���}||ks||krtjcS��tjS) 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 the 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). 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)r�int32�iinfor:r;�int64rU� isinstance�ndarray� TypeErrorrJ� issubdtyperT�integer�can_cast�size)r�r�r��int32min�int32max�arr�minvals rr�r�$s���6�x�����*�*�.�/�/�H��x�����*�*�.�/�/�H� �� �B�H�R�X�&�&�*� *� *��M�&�M�M�M��� � �H� � ��8�O��&�"�*�%�%������$�$���#�r�z�*�*� ��P�D��I�I�P�P�P��� ��}�S�Y�� �3�3� ��#�s�y�#�#�#��� ��{�3�9�b�h�/�/� $�!� ��x�����x�1�}�}���������������H�$�$���(9�(9��8�O�O�O�� �8�Orz1.12)� laplacianc�� |�|d���dS#t$r|�|��YdSwxYw)NrK)�filter)� extractallr�)�tarfile�paths r�tarfile_extractallr�us^��!����4���/�/�/�/�/�� �!�!�!����4� � � � � � �!���s ��>�>c�l�ddl}ddl}t�����}t d�|D����}|sdSt d��}|D]\}|ddkr�|�d��}|�d ��}|�|�d S|d krt |��|krd S�]dS) z8Return True if in an unstable configuration for OpenBLASrNc3�.K�|]}|ddkV��dS)� internal_api�openblasNr)�.0�infos r� <genexpr>z6_in_unstable_openblas_configuration.<locals>.<genexpr>�s,����U�U���n�-��;�U�U�U�U�U�UrFz0.3.16r�r��version� architectureT� neoversen1)�numpyr'rr��anyr&�get)r�r'� modules_info�open_blas_used�openblas_arm64_stable_versionr��openblas_version�openblas_architectures r�#_in_unstable_openblas_configurationr�|s����L�L�L��L�L�L�-�/�/�4�4�6�6�L��U�U� �U�U�U�U�U�N� ���u�%2�(�$;�$;�!�� � �� �� �:� -� -� ��8�8�I�.�.�� $���� 8� 8�� � #�'<�'D��4�4� !�\� 1� 1��.�/�/�2O�O�O��4�4�� �5rz1.4c���tj�d��}|�t||j��st j|||���St j|���||���S)N�polars��indexrw)�sys�modulesr�r�� DataFramer~�to_numpy)rr�rw�pls r�2_create_pandas_dataframe_from_non_pandas_containerr��sb�� �[�_�_�X� &� &�� �:�Z��2�<�8�8�:��<���T�:�:�:� :��|�A�J�J�L�L��D�A�A�A�Arc�0�tj|||���S)Nr�)r~r�)rr�rws rr�r��s���|�A�U��6�6�6�6rc�.�tjdkriSddiS)N)�� �slotsT)r�� version_inforrr�_dataclass_argsr��s�� ��'�!�!�� � �T�?�r)r)rNF)S�__doc__�platform�structr�r�rr'�scipy.sparse.linalg� scipy.stats�pandasr~� ImportError�externals._packaging.versionrr&�parallelr�calcsize� _IS_32BIT�machine�_IS_WASMrx� np_versionry�np_base_versionr%�sp_base_versionr2� csr_matrix�CSR_CONTAINERS� csc_matrix�CSC_CONTAINERSrZ�COO_CONTAINERS� lil_matrix�LIL_CONTAINERS� dok_matrix�DOK_CONTAINERS� bsr_matrix�BSR_CONTAINERS� dia_matrix�DIA_CONTAINERS�appendr � csc_array� coo_array� lil_array� dok_array� bsr_arrayr�� scipy.sparser �SPARRAY_PRESENT�SPARSE_ARRAY_PRESENT�scipy.optimize._linesearchrr�scipy.optimize.linesearchrr rr+r3r4r7r@rDrQrdrk�numpy.exceptionsrsrtr�r�r��externals._scipy.sparse.csgraphr��scipy.sparse.csgraphr�r�r�r�rrr�<module>r�s��������� � � � � � � � ����� � � � �������������������� �B�B�B�����B�A�A�A�A�A�0�0�0�0�0�0� �����$�$� $�� *� � �8� � � �!5� 5�� �]�2�>� *� *� ��-� � 7�8�8�� �]�5�,� -� -� ��-� � 7�8�8���,�)�*���,�)�*���,�)�*���,�)�*���,�)�*���,�)�*���,�)�*���=��"�#�#�}�}�U�';�';�;�;� ���%�,�0�1�1�1����%�,�0�1�1�1����%�,�0�1�1�1����%�,�0�1�1�1����%�,�0�1�1�1����%�,�0�1�1�1����%�,�0�1�1�1��$�$�$�$�$�$��O�O�������O�O�O����� !�&�&�&�&�&�&������!�!�!� ����!����Q�Q�Q�Q�Q�Q�Q�Q�Q�Q���Q�Q�Q�P�P�P�P�P�P�P�P�P�P�Q������� !)�?�?�?�?�?�� � �f�%�%�%�%��J�J� � � � � � � *� *� *� *��m�m�H�-�-�-�-�� �+�.���6�6�6��m�m�H�-�-�-�-� � � � � � � �"�"�"����8O�O�O�$ � � �  � � ����x�(�(�(�(�J�J�J�J�J�J�J�J�J�?�?�?�?�?�?�?�?� � � �+X�+X�+X�^B�B�B�B�L� � �f�%�%�%�%�;�;�;�;�;�;�;�.�.�.�.�.�.�!�!�!����D�>�m�m�B�N�3�3�m�m�E�6J�6J�J�J�B�B�B�B�7�7�7� ����sB�%�/�/�8H�H � H �H�H"�!H"�&H/�/ H?�>H?
Memory