o
    h                     @   s   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d	e g d
ZG dd deZeZeZeZejZej Z e!Z!e"Z"e# Z#Z$e%Z&eZ'e(Z(eZ)dd Z*d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                   @   s   e Zd ZdS )r   N)__name__
__module____qualname__ r   r   g/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/fontTools/misc/py23.pyr   -   s    r   c                  O   s   t d)Nz-'xrange' is not defined. Use 'range' instead.)r   )argskwargsr   r   r   r   A   s   r   c                 C   s   |du rd}|dk r*d|  }t | |\}}||d kr$| dkr$|d7 }t|| S td|  }tj| j|tjd}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dr   r   r   round2E   s   
r3   )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   r3   r   r   r   r   <module>   s:    $