3
¢báW! ã @ s” d dl Z d dlZd dlmZ e jdkr0eZeZneZeZe jd
krfeZ e
ZefZe
Zdd„ Zdd„ Zn"eZ eZefZeZdd„ Zd d„ Zd
d„ ZdS )é N)ÚContexté c C s | j ƒ S )N)Údecode)Úx© r ú/usr/lib/python3.6/_compat.pyÚmaybe_decode s r c C s | j ƒ S )N)Úencode)r r r r Úmaybe_encode s r
c C s | S )Nr )r r r r r s c C s | S )Nr )r r r r r
s c C s, t ttt| ƒƒƒtjd�jt| ƒƒ}t|ƒS )zõ
Python 2 and Python 3 use different rounding strategies in round(). This
function ensures that results are python2/3 compatible and backward
compatible with previous py2 releases
:param what: float
:return: rounded long
)ZprecZrounding)r ÚlenÚstrÚlongÚdecimalZ
ROUND_HALF_UPZcreate_decimal)ZwhatÚdr r r Úround_py2_compat# s
r )r )r )Úsysr r Úversion_infoÚintr
ÚrangeZxranger Z text_typeÚbytesZbinary_typeZstring_typesÚchrZunichrr r
ZunicodeZ
basestringr r r r r Ú