U
    P’“eJ  ã                   @   sÈ   d Z dZddlZddlZddlmZmZ zddlZW n ek
rP   ddl	ZY nX zddlm
Z
 W n ek
rz   dZ
Y nX dZdZeZeZeZdd„ Zd	d„ Zd
d„ ZejZddd„Ze
dkrÄeZ
dS )zÝ
Compatibility module for Python 2.7 and >= 3.4
==============================================

This module provides a set of utility types and functions for optimization and
to aid in writing Python 2/3 compatible code.
)ÚPY2ÚclockÚstring_typesÚqueueÚiterkeysÚ
itervaluesÚ	iteritemsÚiscloseé    N)ÚisinfÚfabs)r   Fc                 C   s   t |  ¡ ƒS ©N)ÚiterÚkeys©Úd© r   ú//tmp/pip-unpacked-wheel-xzebddm3/kivy/compat.pyÚ<lambda>0   ó    r   c                 C   s   t |  ¡ ƒS r   )r   Úvaluesr   r   r   r   r   1   r   c                 C   s   t |  ¡ ƒS r   )r   Úitemsr   r   r   r   r   2   r   ç•Ö&è.>ç        c                 C   st   | |krdS |dk s|dk r$t dƒ‚tt| ƒƒs<tt|ƒƒr@dS t||  ƒ}|t|| ƒkpr|t||  ƒkpr||kS )zªMeasures whether two floats are "close" to each other. Identical to
    https://docs.python.org/3.6/library/math.html#math.isclose, for older
    versions of python.
    Tr   z%error tolerances must be non-negativeF)Ú
ValueErrorr
   Úabsr   )ÚaÚbZrel_tolZabs_tolZdiffr   r   r   Ú_isclose8   s    ÿþr   )r   r   )Ú__doc__Ú__all__ÚsysÚtimeÚmathr
   r   r   ÚImportErrorÚQueuer   r   r   Ústrr   Ú	text_typeÚchrÚunichrr   r   r   Úperf_counterr   r   r   r   r   Ú<module>   s0   

