o
    h                     @   s   d dl mZ dZdZdZefddZeeedZeeedZeeedZ	dd	d
Z
edkr>edd edd e	dd dS dS )    )Iterable91m92m93mc                    s    fdd}|S )z_A decorator to print text in the specified terminal color by wrapping the given print function.c                     s0   t d  dd | i | t ddd d S )Nz[ )endz[00m)print)argskwargscolorfn_print ^/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/thop/utils.pyactual_call   s   z#colorful_print.<locals>.actual_callr   )r   r   r   r   r   r   colorful_print
   s   r   )r   %.2fc                 C   s   t | ts| g} g }| D ]K}|dkr|||d  d  q|dkr.|||d  d  q|dkr>|||d  d  q|dkrN|||d  d  q||| d	  qt|d
krb|d S g |R S )z]Formats numbers into human-readable strings with units (K for thousand, M for million, etc.).g   mBTg    eAGg    .AMg     @@KB   r   )
isinstancer   appendlen)numsformatclever_numsnumr   r   r   clever_format   s   
r    __main__helloworldN)r   )collections.abcr   	COLOR_REDCOLOR_GREENCOLOR_YELLOWr   r   prRedprGreenprYellowr    __name__r   r   r   r   <module>   s   


