
    j                         d dl mZ dZdZdZefdZ eee          Z eee          Z eee          Z	ddZ
ed	k    r& ed
d            ed
d            e	d
d           dS dS )    )Iterable91m92m93mc                       fd}|S )z_A decorator to print text in the specified terminal color by wrapping the given print function.c                  b    t          d d            | i | t          dd           d S )Nz[ )endz[00m)print)argskwargscolorfn_prints     O/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/thop/utils.pyactual_callz#colorful_print.<locals>.actual_call   sJ    oeoo2&&&&$!&!!!jb!!!!!!     )r   r   r   s   `` r   colorful_printr   
   s*    " " " " " "
 r   )r   %.2fc                    t          | t                    s| g} g }| D ]}|dk    r|                    ||dz  z  dz              '|dk    r|                    ||dz  z  dz              L|dk    r|                    ||dz  z  dz              q|dk    r|                    ||dz  z  dz              |                    ||z  d	z              t          |          d
k    r|d         n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nums       r   clever_formatr$      s-   dH%% vK 
3 
3::vt4s:;;;;3YYvs3c9::::3YYvs3c9::::3YYvs3c9::::v|c12222 --22;q>>+Gr   __main__helloworldN)r   )collections.abcr   	COLOR_REDCOLOR_GREENCOLOR_YELLOWr   r   prRedprGreenprYellowr$   __name__r   r   r   <module>r0      s    % $ $ $ $ $	 $-     	uI...
.k
2
2
2>%|444H H H H* z	E'7GGWHWg r   