
    |h                         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
       yy)    )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                  P    t        d d        | i | t        dd       y )Nz[ )endz[00m)print)argskwargscolorfn_prints     I/var/www/html/test/engine/venv/lib/python3.12/site-packages/thop/utils.pyactual_callz#colorful_print.<locals>.actual_call   s*    eWo2&$!&!jb!     )r   r   r   s   `` r   colorful_printr   
   s    "
 r   )r   c                    t        | t              s| g} g }| D ]  }|dkD  r|j                  ||dz  z  dz          #|dkD  r|j                  ||dz  z  dz          C|dkD  r|j                  ||dz  z  dz          c|dkD  r|j                  ||dz  z  dz          |j                  ||z  d	z           t        |      d
k(  r|d   S g |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:vt4s:;3Yvs3c9:3Yvs3c9:3Yvs3c9:v|c12
3 !-2;q>G+Gr   __main__helloworldN)z%.2f)collections.abcr   	COLOR_REDCOLOR_GREENCOLOR_YELLOWr   r   prRedprGreenprYellowr#   __name__r   r   r   <module>r/      s|    %	 $-  	uI.
k
2%|4H* z	'7GWWg r   