r]ޕ \ d dl Z d dlmZ ed dedefd ZdedefdZdS ) N) lru_cached creturnc ( t | }d|cxk rdk rn ndS |dk s.d|cxk rdk s!n d|cxk rdk sn d |cxk rd
k rn ndS t j | }|dk rdS |d
v rdS t j | dv rdS dS )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)MeMn)FW )ordunicodedatacategoryeast_asian_width)r or s e/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/_pytest/_io/wcwidth.pywcwidthr s AA q5q
VQ & Q & Q & q#A&&H 4r <q #A&&*44q1 sc t d}t j d| D ]}t | }|dk r dS ||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
6622
Lr )r functoolsr strintr r r r