a
    ¶ÀhÍ  ã                   @   s.   d dl Z d dlmZ dd„ Zeddd„ƒZdS )é    N)Úcontextmanagerc                 C   sX   d|  }|dkrd|d  }nd| }d||f }dt |ƒ t |ƒ }d||d |f S )	zûCreate one line message for logging purposes.

    Parameters
    ----------
    source : str
        String indicating the source or the reference of the message.

    message : str
        Short message.

    time : int
        Time in seconds.
    z[%s] é<   z%4.1fminz %5.1fsz %s, total=%séF   z%s%s%sÚ.)Úlen)ÚsourceÚmessageÚtimeZstart_messageZtime_strZend_messageZdots_len© r
   úY/var/www/html/assistant/venv/lib/python3.9/site-packages/sklearn/utils/_user_interface.pyÚ_message_with_time   s    r   c                 c   s:   |du rdV  n&t  ¡ }dV  tt| |t  ¡ | ƒƒ dS )aj  Log elapsed time to stdout when the context is exited.

    Parameters
    ----------
    source : str
        String indicating the source or the reference of the message.

    message : str, default=None
        Short message. If None, nothing will be printed.

    Returns
    -------
    context_manager
        Prints elapsed time upon exit if verbose.
    N)ÚtimeitZdefault_timerÚprintr   )r   r   Ústartr
   r
   r   Ú_print_elapsed_time#   s
    r   )N)r   Ú
contextlibr   r   r   r
   r
   r
   r   Ú<module>   s   