� I�gW���dZddlmZddlZddlZddlZddlZddlZddlZddl m Z d�Z d�Z d�Z dd �ZGd �d e��ZGd �de��ZdS)zE Helpers for logging. This module needs much love to become useful. �)�print_functionN�)�mkdirpc�j�tj�d��rtd|dz ��S|S)z�Remove .1s to the time under Windows: this is the time it take to stat files. This is needed to make results similar to timings under Unix, for tests �winrg�������?)�sys�platform� startswith�max��ts �]/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/joblib/logger.py� _squeeze_timers3��  �|���u�%�%���1�a�"�f�~�~����c�4�t|��}d||dz fzS)Nz%.1fs, %.1fmin�N@�rr s r� format_timer"s"���a���A� �q�!�c�'�l� *�*rc�F�t|��}|dkrd|dz zSd|zS)N�<z%4.1fminrz %5.1fsrr s r�short_format_timer's1���a���A��2�v�v��Q��W�%�%��A��r�c���dtjvr1ddl}|���}|�ddd���nd}t j|||���}|r |jdi|��|S) N�numpyr��@r)� precision� threshold� edgeitems)�depth�indent�)r�modulesr�get_printoptions�set_printoptions�pprint�pformat)�objr!r �np� print_options�outs rr'r'/s����#�+��������+�+�-�-� � ���a�2���C�C�C�C�� � �.��E�&� 9� 9� 9�C��-����,�,�m�,�,�,� �Jrc�4�eZdZdZd d�Zd�Zd�Zd�Zd d �ZdS) �Loggerz& Base class for logging messages. rNc�*�||_|r|nd|_dS)z� Parameters ---------- depth: int, optional The depth of objects printed. name: str, optional The namespace to log to. If None, defaults to joblib. �joblibN)r �_name)�selfr �names r�__init__zLogger.__init__Cs���� �!�/�T�T�x�� � � rc�j�tj|j���d|�d|����dS�N�[z]: )�logging� getLoggerr0�warning�r1�msgs r�warnz Logger.warnOs7����$�*�%�%�-�-�-�D�D�D�#�#�.F�G�G�G�G�Grc�:�tjd|�d|����dSr5)r7�infor:s rr>z Logger.infoRs%��� � �4�4�4���-�.�.�.�.�.rc�j�tj|j���d|�d|����dSr5)r7r8r0�debugr:s rr@z Logger.debugUs7����$�*�%�%�+�+�+�$�$�$���,D�E�E�E�E�Errc�0�t|||j���S)z2Return the formatted representation of the object.)r!r )r'r )r1r(r!s r�formatz Logger.formatYs���s�6���<�<�<�<r)rN)r) �__name__� __module__� __qualname__�__doc__r3r<r>r@rBr"rrr-r-?sy�������� 0� 0� 0� 0�H�H�H�/�/�/�F�F�F�=�=�=�=�=�=rr-c�"�eZdZdZdd�Zdd�ZdS) � PrintTimez9 Print and log messages while keeping track of time. Nc��|�|�td���tj��|_|j|_|� tj�|d��}||_|��#ttj� |����tj� |��r`tdd��D].} tj |d|zz|d|dzzz���(#Y�,xYw tj||dz��n#YnxYw t|d��5}|�d��|�d tj|j��z��ddd��dS#1swxYwYdS#YdSxYwdS) Nz&Cannot specify both logfile and logdirz joblib.logr� z.%iz.1�wz Logging joblib python script z ---%s--- )� ValueError�time� last_time� start_time�os�path�join�logfiler�dirname�exists�range�shutil�move�copy�open�write�ctime)r1rS�logdir�is rr3zPrintTime.__init__es��� � �6�#5��E�F�F� F��������.��� � ��g�l�l�6�<�8�8�G��� � � � �2�7�?�?�7�+�+� ,� ,� ,��w�~�~�g�&�&� -��q�!���1�1�A�1�� �G�e�a�i�$7�$+�e�q�1�u�o�$=�?�?�?�?��1�0�0����-��K���4��8�8�8�8��-�,�,���� ��'�3�'�'�O�7��M�M�"D�E�E�E��M�M�.�4�:�d�n�3M�3M�"M�N�N�N�O�O�O�O�O�O�O�O�O�O�O�O����O�O�O�O�O�O�� �������+ � sI�$C'�'C+�/D�D �E?� AE2�% E?�2E6�6E?�9E6�:E?�?F�Fc��|s0tj��|jz }|�dt|����}n&tj��|jz }d|||dz fz}t |t j���|j�G t|jd��5}t ||���ddd��n #1swxYwYn#YnxYwtj��|_dS)zr Print the time elapsed between the last call and the current call, with an optional message. z: z%s: %.2fs, %.1f minr)�fileN�a) rMrNrrO�printr�stderrrSrZ)r1r;�total� time_lapse�full_msg�fs r�__call__zPrintTime.__call__�s*��� A�����t�~�5�J�#&�3�3� �J�(?�(?�(?�@�H�H�����t��6�J�,��Z�0:�R��0A�A�H� �h�S�Z�(�(�(�(� �<� #� ��$�,��,�,�,���(��+�+�+�+�,�,�,�,�,�,�,�,�,�,�,����,�,�,�,��� ������ �������s0�<B;�B/�# B;�/B3�3B;�6B3�7B;�;B?)NN)r_F)rCrDrErFr3rir"rrrHrHasG��������!�!�!�!�J%�%�%�%�%�%rrH)rr)rF� __future__rrMrrPrWr7r&�diskrrrrr'�objectr-rHr"rr�<module>rms����&�%�%�%�%�%� � � � � � � � � � � � � � � � ����� � � � ����������+�+�+� ��� � � � � =�=�=�=�=�V�=�=�=�DA%�A%�A%�A%�A%��A%�A%�A%�A%�A%r
Memory