
    ]Mh                        d Z ddlZddlZddlZddlmZmZ ddl	m
Z
 ddl	mZ ddlmZ ddlmZmZmZmZmZmZmZ  ej        d	e           g d
Z G d de          ZeZeZeZej        Zej         Z e!Z!e"Z"e#xZ#Z$e%Z&eZ'e(Z(eZ)d Z*ddZ+dS )z"Python 2/3 compat layer leftovers.    N)redirect_stderrredirect_stdout)BytesIO)StringIO)SimpleNamespace   )Tagbytechrbyteord	bytesjoinstrjointobytestostrzeThe py23 module has been deprecated and will be removed in a future release. Please update your code.)
basestringr
   r   r   r   open	Py23ErrorrangeRecursionErrorroundr   r   r   r	   r   r   	tounicodeunichrunicode	UnicodeIOxrangezipc                       e Zd ZdS )r   N)__name__
__module____qualname__     S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/fontTools/misc/py23.pyr   r   -   s        Dr!   r   c                       t          d          )Nz-'xrange' is not defined. Use 'range' instead.)r   )argskwargss     r"   r   r   A   s    
C
D
DDr!   c                 ^   |d}|dk     r?d| z  }t          | |          \  }}||dz  k    r| dk    r|dz  }t          ||z            S t          j        d          | z  }t          j                            |                               |t          j                  }t          |          S )a  
    Implementation of Python 2 built-in round() function.
    Rounds a number to a given precision in decimal digits (default
    0 digits). The result is a floating point number. Values are rounded
    to the closest multiple of 10 to the power minus ndigits; if two
    multiples are equally close, rounding is done away from 0.
    ndigits may be negative.
    See Python 2 documentation:
    https://docs.python.org/2/library/functions.html?highlight=round#round
    Nr   
      r   10)rounding)divmodfloat_decimalDecimal
from_floatquantizeROUND_HALF_UP)numberndigitsexponentquotient	remainderds         r"   round2r8   E   s     {{7(#$VX66)A%%&A++MHX()))#D))wh7''//88x5 9 
 
 Qxxr!   )N),__doc__decimalr-   math_mathwarnings
contextlibr   r   ior   r   r   typesr   	textToolsr	   r
   r   r   r   r   r   warnDeprecationWarning__all__NotImplementedErrorr   r   strr   iscloseisfiniter   r   r   round3chrr   r   r   r   r   r8   r    r!   r"   <module>rK      s   ( (          7 7 7 7 7 7 7 7       $ $ $ $ $ $ ! ! ! ! ! ! P P P P P P P P P P P P P P P P P P     4	 	 	 	 	# 	 	 	  

-> 	
		E E E     r!   