3 bW!@sddlZddlZddlmZejd kr0eZeZneZeZejd krfeZ e Z efZ e ZddZddZn"eZ eZ efZ eZddZd dZd d ZdS)N)ContextcCs|jS)N)decode)xr/usr/lib/python3.6/_compat.py maybe_decodesrcCs|jS)N)encode)rrrr maybe_encodesr cCs|S)Nr)rrrrrscCs|S)Nr)rrrrr scCs,tttt|tjdjt|}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)rlenstrlongdecimalZ ROUND_HALF_UPZcreate_decimal)Zwhatdrrrround_py2_compat#s   r)r)r)sysrr version_infointr rangeZxranger Z text_typebytesZ binary_typeZ string_typeschrZunichrrr ZunicodeZ basestringrrrrrs*