
    F-Ph	                    X    d dl mZ d dlmZ d dlZ ed          dd	            ZddZdS )    )annotations)	lru_cacheNd   cstrreturnintc                (   t          |           }d|cxk    rdk     rn ndS |dk    s.d|cxk    rdk    s!n d|cxk    rdk    sn d	|cxk    rd
k    rn ndS t          j        |           }|dk    rdS |dv rdS t          j        |           dv rdS dS )zDetermine how many columns are needed to display a character in a terminal.

    Returns -1 if the character is not printable.
    Returns 0, 1 or 2 for other characters.
              r   i   i   i(   i.   i`   ic   Cc)MeMn)FW   )ordunicodedatacategoryeast_asian_width)r   or   s      S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/_pytest/_io/wcwidth.pywcwidthr      s     	AA q5q 	
VQ    &    Q    &    Q    &     q#A&&H 4r <q #A&&*44q1    sc                t    d}t          j        d|           D ]}t          |          }|dk     r dS ||z  } |S )zDetermine how many columns are needed to display a string in a terminal.

    Returns -1 if the string contains non-printable characters.
    r   NFCr   )r   	normalizer   )r   widthr   wcs       r   wcswidthr#   .   sP    
 E"5!,,  QZZ6622Lr   )r   r   r   r	   )r   r   r   r	   )
__future__r   	functoolsr   r   r   r#    r   r   <module>r'      s|    " " " " " "           3# # # #L     r   