3 ¢báW!ã@s”ddlZddlZddlmZejd kr0eZeZneZeZejd krfeZ e Z efZ e Zdd„Zdd„Zn"eZ eZ efZ eZdd„Zd d„Zd d „ZdS)éN)ÚContextécCs|jƒS)N)Údecode)Úx©rú/usr/lib/python3.6/_compat.pyÚ maybe_decodesrcCs|jƒS)N)Úencode)rrrrÚ maybe_encodesr cCs|S)Nr)rrrrrscCs|S)Nr)rrrrr scCs,tttt|ƒƒƒ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ÚdrrrÚround_py2_compat#s   r)r)r)ÚsysrrÚ version_infoÚintr ÚrangeZxranger Z text_typeÚbytesZ binary_typeZ string_typesÚchrZunichrrr ZunicodeZ basestringrrrrrÚs*