a
    f                     @   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rxedd edd e	dd dS )    )IterableZ91mZ92mZ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 F/var/www/html/django/DPS/env/lib/python3.9/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 ]}|dkr<|||d  d  q|dkr\|||d  d  q|dkr||||d  d  q|dkr|||d  d  q||| d	  qt|d
kr|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formatZclever_numsnumr   r   r   clever_format   s    
r   __main__ZhelloZworldN)r   )collections.abcr   Z	COLOR_REDZCOLOR_GREENZCOLOR_YELLOWr   r   ZprRedZprGreenZprYellowr   __name__r   r   r   r   <module>   s   


