SILENT KILLERPanel

Current Path: > > opt > > alt > python39 > lib64 > python3.9 > __pycache__


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt//alt/python39/lib64/python3.9/__pycache__

NameTypeSizeLast ModifiedActions
__future__.cpython-39.opt-1.pyc File 4139 bytes June 19 2025 12:11:15.
__future__.cpython-39.opt-2.pyc File 2167 bytes June 19 2025 12:11:17.
__future__.cpython-39.pyc File 4139 bytes June 19 2025 12:11:15.
__phello__.foo.cpython-39.opt-1.pyc File 142 bytes June 19 2025 12:11:11.
__phello__.foo.cpython-39.opt-2.pyc File 142 bytes June 19 2025 12:11:11.
__phello__.foo.cpython-39.pyc File 142 bytes June 19 2025 12:11:11.
_aix_support.cpython-39.opt-1.pyc File 3059 bytes June 19 2025 12:11:11.
_aix_support.cpython-39.opt-2.pyc File 1704 bytes June 19 2025 12:11:17.
_aix_support.cpython-39.pyc File 3059 bytes June 19 2025 12:11:11.
_bootlocale.cpython-39.opt-1.pyc File 1230 bytes June 19 2025 12:11:04.
_bootlocale.cpython-39.opt-2.pyc File 1005 bytes June 19 2025 12:11:07.
_bootlocale.cpython-39.pyc File 1240 bytes June 19 2025 12:11:01.
_bootsubprocess.cpython-39.opt-1.pyc File 2258 bytes June 19 2025 12:11:01.
_bootsubprocess.cpython-39.opt-2.pyc File 2029 bytes June 19 2025 12:11:07.
_bootsubprocess.cpython-39.pyc File 2258 bytes June 19 2025 12:11:01.
_collections_abc.cpython-39.opt-1.pyc File 31744 bytes June 19 2025 12:11:01.
_collections_abc.cpython-39.opt-2.pyc File 26254 bytes June 19 2025 12:11:07.
_collections_abc.cpython-39.pyc File 31744 bytes June 19 2025 12:11:01.
_compat_pickle.cpython-39.opt-1.pyc File 5448 bytes June 19 2025 12:11:07.
_compat_pickle.cpython-39.opt-2.pyc File 5448 bytes June 19 2025 12:11:07.
_compat_pickle.cpython-39.pyc File 5501 bytes June 19 2025 12:11:04.
_compression.cpython-39.opt-1.pyc File 4211 bytes June 19 2025 12:11:01.
_compression.cpython-39.opt-2.pyc File 3997 bytes June 19 2025 12:11:07.
_compression.cpython-39.pyc File 4211 bytes June 19 2025 12:11:01.
_markupbase.cpython-39.opt-1.pyc File 7639 bytes June 19 2025 12:11:04.
_markupbase.cpython-39.opt-2.pyc File 7261 bytes June 19 2025 12:11:07.
_markupbase.cpython-39.pyc File 7790 bytes June 19 2025 12:11:01.
_osx_support.cpython-39.opt-1.pyc File 11595 bytes June 19 2025 12:11:11.
_osx_support.cpython-39.opt-2.pyc File 8905 bytes June 19 2025 12:11:17.
_osx_support.cpython-39.pyc File 11595 bytes June 19 2025 12:11:11.
_py_abc.cpython-39.opt-1.pyc File 4647 bytes June 19 2025 12:11:16.
_py_abc.cpython-39.opt-2.pyc File 3434 bytes June 19 2025 12:11:17.
_py_abc.cpython-39.pyc File 4669 bytes June 19 2025 12:11:11.
_pydecimal.cpython-39.opt-1.pyc File 160626 bytes June 19 2025 12:11:04.
_pydecimal.cpython-39.opt-2.pyc File 79009 bytes June 19 2025 12:11:07.
_pydecimal.cpython-39.pyc File 160626 bytes June 19 2025 12:11:00.
_pyio.cpython-39.opt-1.pyc File 74380 bytes June 19 2025 12:11:04.
_pyio.cpython-39.opt-2.pyc File 51583 bytes June 19 2025 12:11:07.
_pyio.cpython-39.pyc File 74400 bytes June 19 2025 12:11:01.
_sitebuiltins.cpython-39.opt-1.pyc File 3514 bytes June 19 2025 12:11:01.
_sitebuiltins.cpython-39.opt-2.pyc File 2990 bytes June 19 2025 12:11:07.
_sitebuiltins.cpython-39.pyc File 3514 bytes June 19 2025 12:11:01.
_strptime.cpython-39.opt-1.pyc File 16028 bytes June 19 2025 12:11:11.
_strptime.cpython-39.opt-2.pyc File 12300 bytes June 19 2025 12:11:17.
_strptime.cpython-39.pyc File 16028 bytes June 19 2025 12:11:11.
_sysconfigdata__linux_x86_64-linux-gnu.cpython-39.opt-1.pyc File 29956 bytes June 19 2025 12:11:04.
_sysconfigdata__linux_x86_64-linux-gnu.cpython-39.opt-2.pyc File 29956 bytes June 19 2025 12:11:04.
_sysconfigdata__linux_x86_64-linux-gnu.cpython-39.pyc File 29956 bytes June 19 2025 12:11:04.
_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-39.opt-1.pyc File 29800 bytes June 19 2025 12:11:00.
_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-39.opt-2.pyc File 29800 bytes June 19 2025 12:11:00.
_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-39.pyc File 29800 bytes June 19 2025 12:11:00.
_threading_local.cpython-39.opt-1.pyc File 6519 bytes June 19 2025 12:11:01.
_threading_local.cpython-39.opt-2.pyc File 3199 bytes June 19 2025 12:11:07.
_threading_local.cpython-39.pyc File 6519 bytes June 19 2025 12:11:01.
_weakrefset.cpython-39.opt-1.pyc File 7737 bytes June 19 2025 12:11:00.
_weakrefset.cpython-39.opt-2.pyc File 7737 bytes June 19 2025 12:11:00.
_weakrefset.cpython-39.pyc File 7737 bytes June 19 2025 12:11:00.
abc.cpython-39.opt-1.pyc File 5788 bytes June 19 2025 12:11:01.
abc.cpython-39.opt-2.pyc File 3229 bytes June 19 2025 12:11:07.
abc.cpython-39.pyc File 5788 bytes June 19 2025 12:11:01.
aifc.cpython-39.opt-1.pyc File 25279 bytes June 19 2025 12:11:11.
aifc.cpython-39.opt-2.pyc File 20072 bytes June 19 2025 12:11:17.
aifc.cpython-39.pyc File 25279 bytes June 19 2025 12:11:11.
antigravity.cpython-39.opt-1.pyc File 832 bytes June 19 2025 12:11:01.
antigravity.cpython-39.opt-2.pyc File 688 bytes June 19 2025 12:11:07.
antigravity.cpython-39.pyc File 832 bytes June 19 2025 12:11:01.
argparse.cpython-39.opt-1.pyc File 63556 bytes June 19 2025 12:11:16.
argparse.cpython-39.opt-2.pyc File 54192 bytes June 19 2025 12:11:17.
argparse.cpython-39.pyc File 63667 bytes June 19 2025 12:11:11.
ast.cpython-39.opt-1.pyc File 52345 bytes June 19 2025 12:11:16.
ast.cpython-39.opt-2.pyc File 43800 bytes June 19 2025 12:11:17.
ast.cpython-39.pyc File 52396 bytes June 19 2025 12:11:11.
asynchat.cpython-39.opt-1.pyc File 6835 bytes June 19 2025 12:11:04.
asynchat.cpython-39.opt-2.pyc File 5460 bytes June 19 2025 12:11:10.
asynchat.cpython-39.pyc File 6835 bytes June 19 2025 12:11:04.
asyncore.cpython-39.opt-1.pyc File 16049 bytes June 19 2025 12:11:15.
asyncore.cpython-39.opt-2.pyc File 14845 bytes June 19 2025 12:11:17.
asyncore.cpython-39.pyc File 16049 bytes June 19 2025 12:11:15.
base64.cpython-39.opt-1.pyc File 16336 bytes June 19 2025 12:11:04.
base64.cpython-39.opt-2.pyc File 10816 bytes June 19 2025 12:11:07.
base64.cpython-39.pyc File 16468 bytes June 19 2025 12:11:01.
bdb.cpython-39.opt-1.pyc File 24553 bytes June 19 2025 12:11:04.
bdb.cpython-39.opt-2.pyc File 15516 bytes June 19 2025 12:11:10.
bdb.cpython-39.pyc File 24553 bytes June 19 2025 12:11:04.
binhex.cpython-39.opt-1.pyc File 12978 bytes June 19 2025 12:11:01.
binhex.cpython-39.opt-2.pyc File 12444 bytes June 19 2025 12:11:07.
binhex.cpython-39.pyc File 12978 bytes June 19 2025 12:11:01.
bisect.cpython-39.opt-1.pyc File 2363 bytes June 19 2025 12:11:00.
bisect.cpython-39.opt-2.pyc File 1051 bytes June 19 2025 12:11:07.
bisect.cpython-39.pyc File 2363 bytes June 19 2025 12:11:00.
bz2.cpython-39.opt-1.pyc File 11558 bytes June 19 2025 12:11:11.
bz2.cpython-39.opt-2.pyc File 6542 bytes June 19 2025 12:11:17.
bz2.cpython-39.pyc File 11558 bytes June 19 2025 12:11:11.
cProfile.cpython-39.opt-1.pyc File 5129 bytes June 19 2025 12:11:00.
cProfile.cpython-39.opt-2.pyc File 4668 bytes June 19 2025 12:11:07.
cProfile.cpython-39.pyc File 5129 bytes June 19 2025 12:11:00.
calendar.cpython-39.opt-1.pyc File 27044 bytes June 19 2025 12:11:10.
calendar.cpython-39.opt-2.pyc File 22452 bytes June 19 2025 12:11:17.
calendar.cpython-39.pyc File 27044 bytes June 19 2025 12:11:10.
cgi.cpython-39.opt-1.pyc File 26495 bytes June 19 2025 12:11:11.
cgi.cpython-39.opt-2.pyc File 18069 bytes June 19 2025 12:11:17.
cgi.cpython-39.pyc File 26495 bytes June 19 2025 12:11:11.
cgitb.cpython-39.opt-1.pyc File 10199 bytes June 19 2025 12:11:15.
cgitb.cpython-39.opt-2.pyc File 8600 bytes June 19 2025 12:11:17.
cgitb.cpython-39.pyc File 10199 bytes June 19 2025 12:11:15.
chunk.cpython-39.opt-1.pyc File 4854 bytes June 19 2025 12:11:01.
chunk.cpython-39.opt-2.pyc File 2710 bytes June 19 2025 12:11:07.
chunk.cpython-39.pyc File 4854 bytes June 19 2025 12:11:01.
cmd.cpython-39.opt-1.pyc File 12689 bytes June 19 2025 12:11:00.
cmd.cpython-39.opt-2.pyc File 7264 bytes June 19 2025 12:11:07.
cmd.cpython-39.pyc File 12689 bytes June 19 2025 12:11:00.
code.cpython-39.opt-1.pyc File 9929 bytes June 19 2025 12:11:01.
code.cpython-39.opt-2.pyc File 4658 bytes June 19 2025 12:11:07.
code.cpython-39.pyc File 9929 bytes June 19 2025 12:11:01.
codecs.cpython-39.opt-1.pyc File 33901 bytes June 19 2025 12:11:01.
codecs.cpython-39.opt-2.pyc File 18329 bytes June 19 2025 12:11:07.
codecs.cpython-39.pyc File 33901 bytes June 19 2025 12:11:01.
codeop.cpython-39.opt-1.pyc File 6471 bytes June 19 2025 12:11:01.
codeop.cpython-39.opt-2.pyc File 2411 bytes June 19 2025 12:11:07.
codeop.cpython-39.pyc File 6471 bytes June 19 2025 12:11:01.
colorsys.cpython-39.opt-1.pyc File 3273 bytes June 19 2025 12:11:01.
colorsys.cpython-39.opt-2.pyc File 2667 bytes June 19 2025 12:11:07.
colorsys.cpython-39.pyc File 3273 bytes June 19 2025 12:11:01.
compileall.cpython-39.opt-1.pyc File 12602 bytes June 19 2025 12:11:01.
compileall.cpython-39.opt-2.pyc File 9343 bytes June 19 2025 12:11:07.
compileall.cpython-39.pyc File 12602 bytes June 19 2025 12:11:01.
configparser.cpython-39.opt-1.pyc File 45882 bytes June 19 2025 12:11:04.
configparser.cpython-39.opt-2.pyc File 30742 bytes June 19 2025 12:11:07.
configparser.cpython-39.pyc File 45882 bytes June 19 2025 12:11:01.
contextlib.cpython-39.opt-1.pyc File 19541 bytes June 19 2025 12:11:04.
contextlib.cpython-39.opt-2.pyc File 13956 bytes June 19 2025 12:11:07.
contextlib.cpython-39.pyc File 19551 bytes June 19 2025 12:11:01.
contextvars.cpython-39.opt-1.pyc File 258 bytes June 19 2025 12:11:04.
contextvars.cpython-39.opt-2.pyc File 258 bytes June 19 2025 12:11:04.
contextvars.cpython-39.pyc File 258 bytes June 19 2025 12:11:04.
copy.cpython-39.opt-1.pyc File 6976 bytes June 19 2025 12:11:01.
copy.cpython-39.opt-2.pyc File 4673 bytes June 19 2025 12:11:07.
copy.cpython-39.pyc File 6976 bytes June 19 2025 12:11:01.
copyreg.cpython-39.opt-1.pyc File 4424 bytes June 19 2025 12:11:16.
copyreg.cpython-39.opt-2.pyc File 3622 bytes June 19 2025 12:11:17.
copyreg.cpython-39.pyc File 4443 bytes June 19 2025 12:11:11.
crypt.cpython-39.opt-1.pyc File 3526 bytes June 19 2025 12:11:01.
crypt.cpython-39.opt-2.pyc File 2864 bytes June 19 2025 12:11:07.
crypt.cpython-39.pyc File 3526 bytes June 19 2025 12:11:01.
csv.cpython-39.opt-1.pyc File 11862 bytes June 19 2025 12:11:01.
csv.cpython-39.opt-2.pyc File 9821 bytes June 19 2025 12:11:07.
csv.cpython-39.pyc File 11862 bytes June 19 2025 12:11:01.
dataclasses.cpython-39.opt-1.pyc File 23230 bytes June 19 2025 12:11:11.
dataclasses.cpython-39.opt-2.pyc File 19791 bytes June 19 2025 12:11:17.
dataclasses.cpython-39.pyc File 23230 bytes June 19 2025 12:11:11.
datetime.cpython-39.opt-1.pyc File 56987 bytes June 19 2025 12:11:16.
datetime.cpython-39.opt-2.pyc File 48543 bytes June 19 2025 12:11:17.
datetime.cpython-39.pyc File 58128 bytes June 19 2025 12:11:16.
decimal.cpython-39.opt-1.pyc File 372 bytes June 19 2025 12:11:10.
decimal.cpython-39.opt-2.pyc File 372 bytes June 19 2025 12:11:10.
decimal.cpython-39.pyc File 372 bytes June 19 2025 12:11:10.
difflib.cpython-39.opt-1.pyc File 58571 bytes June 19 2025 12:11:04.
difflib.cpython-39.opt-2.pyc File 25037 bytes June 19 2025 12:11:07.
difflib.cpython-39.pyc File 58593 bytes June 19 2025 12:11:01.
dis.cpython-39.opt-1.pyc File 15833 bytes June 19 2025 12:11:01.
dis.cpython-39.opt-2.pyc File 12026 bytes June 19 2025 12:11:07.
dis.cpython-39.pyc File 15833 bytes June 19 2025 12:11:01.
doctest.cpython-39.opt-1.pyc File 75845 bytes June 19 2025 12:11:04.
doctest.cpython-39.opt-2.pyc File 40539 bytes June 19 2025 12:11:07.
doctest.cpython-39.pyc File 76052 bytes June 19 2025 12:11:01.
enum.cpython-39.opt-1.pyc File 26033 bytes June 19 2025 12:11:01.
enum.cpython-39.opt-2.pyc File 21111 bytes June 19 2025 12:11:07.
enum.cpython-39.pyc File 26033 bytes June 19 2025 12:11:01.
filecmp.cpython-39.opt-1.pyc File 8635 bytes June 19 2025 12:11:01.
filecmp.cpython-39.opt-2.pyc File 6097 bytes June 19 2025 12:11:07.
filecmp.cpython-39.pyc File 8635 bytes June 19 2025 12:11:01.
fileinput.cpython-39.opt-1.pyc File 13803 bytes June 19 2025 12:11:01.
fileinput.cpython-39.opt-2.pyc File 8195 bytes June 19 2025 12:11:07.
fileinput.cpython-39.pyc File 13803 bytes June 19 2025 12:11:01.
fnmatch.cpython-39.opt-1.pyc File 3883 bytes June 19 2025 12:11:04.
fnmatch.cpython-39.opt-2.pyc File 2675 bytes June 19 2025 12:11:07.
fnmatch.cpython-39.pyc File 3955 bytes June 19 2025 12:11:01.
formatter.cpython-39.opt-1.pyc File 17552 bytes June 19 2025 12:11:01.
formatter.cpython-39.opt-2.pyc File 15112 bytes June 19 2025 12:11:07.
formatter.cpython-39.pyc File 17552 bytes June 19 2025 12:11:01.
fractions.cpython-39.opt-1.pyc File 18062 bytes June 19 2025 12:11:00.
fractions.cpython-39.opt-2.pyc File 10862 bytes June 19 2025 12:11:07.
fractions.cpython-39.pyc File 18062 bytes June 19 2025 12:11:00.
ftplib.cpython-39.opt-1.pyc File 28707 bytes June 19 2025 12:11:01.
ftplib.cpython-39.opt-2.pyc File 18563 bytes June 19 2025 12:11:07.
ftplib.cpython-39.pyc File 28707 bytes June 19 2025 12:11:01.
functools.cpython-39.opt-1.pyc File 28736 bytes June 19 2025 12:11:16.
functools.cpython-39.opt-2.pyc File 22015 bytes June 19 2025 12:11:17.
functools.cpython-39.pyc File 28736 bytes June 19 2025 12:11:16.
genericpath.cpython-39.opt-1.pyc File 4554 bytes June 19 2025 12:11:16.
genericpath.cpython-39.opt-2.pyc File 3371 bytes June 19 2025 12:11:17.
genericpath.cpython-39.pyc File 4554 bytes June 19 2025 12:11:16.
getopt.cpython-39.opt-1.pyc File 6255 bytes June 19 2025 12:11:16.
getopt.cpython-39.opt-2.pyc File 3701 bytes June 19 2025 12:11:17.
getopt.cpython-39.pyc File 6273 bytes June 19 2025 12:11:11.
getpass.cpython-39.opt-1.pyc File 4213 bytes June 19 2025 12:11:00.
getpass.cpython-39.opt-2.pyc File 3027 bytes June 19 2025 12:11:07.
getpass.cpython-39.pyc File 4213 bytes June 19 2025 12:11:00.
gettext.cpython-39.opt-1.pyc File 18086 bytes June 19 2025 12:11:11.
gettext.cpython-39.opt-2.pyc File 17395 bytes June 19 2025 12:11:17.
gettext.cpython-39.pyc File 18086 bytes June 19 2025 12:11:11.
glob.cpython-39.opt-1.pyc File 4518 bytes June 19 2025 12:11:04.
glob.cpython-39.opt-2.pyc File 3658 bytes June 19 2025 12:11:07.
glob.cpython-39.pyc File 4557 bytes June 19 2025 12:11:01.
graphlib.cpython-39.opt-1.pyc File 7535 bytes June 19 2025 12:11:04.
graphlib.cpython-39.opt-2.pyc File 4099 bytes June 19 2025 12:11:07.
graphlib.cpython-39.pyc File 7581 bytes June 19 2025 12:11:00.
gzip.cpython-39.opt-1.pyc File 18507 bytes June 19 2025 12:11:11.
gzip.cpython-39.opt-2.pyc File 14640 bytes June 19 2025 12:11:17.
gzip.cpython-39.pyc File 18507 bytes June 19 2025 12:11:11.
hashlib.cpython-39.opt-1.pyc File 6704 bytes June 19 2025 12:11:15.
hashlib.cpython-39.opt-2.pyc File 6136 bytes June 19 2025 12:11:17.
hashlib.cpython-39.pyc File 6704 bytes June 19 2025 12:11:15.
heapq.cpython-39.opt-1.pyc File 14053 bytes June 19 2025 12:11:00.
heapq.cpython-39.opt-2.pyc File 11037 bytes June 19 2025 12:11:07.
heapq.cpython-39.pyc File 14053 bytes June 19 2025 12:11:00.
hmac.cpython-39.opt-1.pyc File 6813 bytes June 19 2025 12:11:01.
hmac.cpython-39.opt-2.pyc File 4296 bytes June 19 2025 12:11:07.
hmac.cpython-39.pyc File 6813 bytes June 19 2025 12:11:01.
imaplib.cpython-39.opt-1.pyc File 40398 bytes June 19 2025 12:11:16.
imaplib.cpython-39.opt-2.pyc File 27715 bytes June 19 2025 12:11:17.
imaplib.cpython-39.pyc File 42579 bytes June 19 2025 12:11:11.
imghdr.cpython-39.opt-1.pyc File 4153 bytes June 19 2025 12:11:11.
imghdr.cpython-39.opt-2.pyc File 3838 bytes June 19 2025 12:11:17.
imghdr.cpython-39.pyc File 4153 bytes June 19 2025 12:11:11.
imp.cpython-39.opt-1.pyc File 9864 bytes June 19 2025 12:11:01.
imp.cpython-39.opt-2.pyc File 7499 bytes June 19 2025 12:11:07.
imp.cpython-39.pyc File 9864 bytes June 19 2025 12:11:01.
inspect.cpython-39.opt-1.pyc File 81243 bytes June 19 2025 12:11:07.
inspect.cpython-39.opt-2.pyc File 56115 bytes June 19 2025 12:11:10.
inspect.cpython-39.pyc File 81485 bytes June 19 2025 12:11:04.
io.cpython-39.opt-1.pyc File 3421 bytes June 19 2025 12:11:01.
io.cpython-39.opt-2.pyc File 1932 bytes June 19 2025 12:11:07.
io.cpython-39.pyc File 3421 bytes June 19 2025 12:11:01.
ipaddress.cpython-39.opt-1.pyc File 65695 bytes June 19 2025 12:11:11.
ipaddress.cpython-39.opt-2.pyc File 39715 bytes June 19 2025 12:11:17.
ipaddress.cpython-39.pyc File 65695 bytes June 19 2025 12:11:11.
keyword.cpython-39.opt-1.pyc File 929 bytes June 19 2025 12:11:11.
keyword.cpython-39.opt-2.pyc File 525 bytes June 19 2025 12:11:17.
keyword.cpython-39.pyc File 929 bytes June 19 2025 12:11:11.
linecache.cpython-39.opt-1.pyc File 4041 bytes June 19 2025 12:11:01.
linecache.cpython-39.opt-2.pyc File 2808 bytes June 19 2025 12:11:07.
linecache.cpython-39.pyc File 4041 bytes June 19 2025 12:11:01.
locale.cpython-39.opt-1.pyc File 34709 bytes June 19 2025 12:11:04.
locale.cpython-39.opt-2.pyc File 30091 bytes June 19 2025 12:11:10.
locale.cpython-39.pyc File 34709 bytes June 19 2025 12:11:04.
lzma.cpython-39.opt-1.pyc File 12107 bytes June 19 2025 12:11:11.
lzma.cpython-39.opt-2.pyc File 5909 bytes June 19 2025 12:11:17.
lzma.cpython-39.pyc File 12107 bytes June 19 2025 12:11:11.
mailbox.cpython-39.opt-1.pyc File 60559 bytes June 19 2025 12:11:07.
mailbox.cpython-39.opt-2.pyc File 53955 bytes June 19 2025 12:11:10.
mailbox.cpython-39.pyc File 60613 bytes June 19 2025 12:11:04.
mailcap.cpython-39.opt-1.pyc File 7252 bytes June 19 2025 12:11:04.
mailcap.cpython-39.opt-2.pyc File 5682 bytes June 19 2025 12:11:07.
mailcap.cpython-39.pyc File 7252 bytes June 19 2025 12:11:00.
mimetypes.cpython-39.opt-1.pyc File 16028 bytes June 19 2025 12:11:04.
mimetypes.cpython-39.opt-2.pyc File 10013 bytes June 19 2025 12:11:10.
mimetypes.cpython-39.pyc File 16028 bytes June 19 2025 12:11:04.
modulefinder.cpython-39.opt-1.pyc File 16095 bytes June 19 2025 12:11:04.
modulefinder.cpython-39.opt-2.pyc File 15186 bytes June 19 2025 12:11:07.
modulefinder.cpython-39.pyc File 16141 bytes June 19 2025 12:11:01.
netrc.cpython-39.opt-1.pyc File 3796 bytes June 19 2025 12:11:01.
netrc.cpython-39.opt-2.pyc File 3558 bytes June 19 2025 12:11:07.
netrc.cpython-39.pyc File 3796 bytes June 19 2025 12:11:01.
nntplib.cpython-39.opt-1.pyc File 31776 bytes June 19 2025 12:11:00.
nntplib.cpython-39.opt-2.pyc File 20176 bytes June 19 2025 12:11:07.
nntplib.cpython-39.pyc File 31776 bytes June 19 2025 12:11:00.
ntpath.cpython-39.opt-1.pyc File 14825 bytes June 19 2025 12:11:04.
ntpath.cpython-39.opt-2.pyc File 12774 bytes June 19 2025 12:11:07.
ntpath.cpython-39.pyc File 14825 bytes June 19 2025 12:11:01.
nturl2path.cpython-39.opt-1.pyc File 1759 bytes June 19 2025 12:11:11.
nturl2path.cpython-39.opt-2.pyc File 1340 bytes June 19 2025 12:11:17.
nturl2path.cpython-39.pyc File 1759 bytes June 19 2025 12:11:11.
numbers.cpython-39.opt-1.pyc File 12332 bytes June 19 2025 12:11:11.
numbers.cpython-39.opt-2.pyc File 8375 bytes June 19 2025 12:11:17.
numbers.cpython-39.pyc File 12332 bytes June 19 2025 12:11:11.
opcode.cpython-39.opt-1.pyc File 5236 bytes June 19 2025 12:11:16.
opcode.cpython-39.opt-2.pyc File 5095 bytes June 19 2025 12:11:17.
opcode.cpython-39.pyc File 5236 bytes June 19 2025 12:11:16.
operator.cpython-39.opt-1.pyc File 13797 bytes June 19 2025 12:11:04.
operator.cpython-39.opt-2.pyc File 11408 bytes June 19 2025 12:11:10.
operator.cpython-39.pyc File 13797 bytes June 19 2025 12:11:04.
optparse.cpython-39.opt-1.pyc File 47901 bytes June 19 2025 12:11:16.
optparse.cpython-39.opt-2.pyc File 35586 bytes June 19 2025 12:11:17.
optparse.cpython-39.pyc File 47956 bytes June 19 2025 12:11:11.
os.cpython-39.opt-1.pyc File 31643 bytes June 19 2025 12:11:04.
os.cpython-39.opt-2.pyc File 19453 bytes June 19 2025 12:11:07.
os.cpython-39.pyc File 31659 bytes June 19 2025 12:11:01.
pathlib.cpython-39.opt-1.pyc File 43541 bytes June 19 2025 12:11:10.
pathlib.cpython-39.opt-2.pyc File 34681 bytes June 19 2025 12:11:16.
pathlib.cpython-39.pyc File 43541 bytes June 19 2025 12:11:10.
pdb.cpython-39.opt-1.pyc File 47560 bytes June 19 2025 12:11:04.
pdb.cpython-39.opt-2.pyc File 33489 bytes June 19 2025 12:11:07.
pdb.cpython-39.pyc File 47599 bytes June 19 2025 12:11:01.
pickle.cpython-39.opt-1.pyc File 47025 bytes June 19 2025 12:11:04.
pickle.cpython-39.opt-2.pyc File 41155 bytes June 19 2025 12:11:07.
pickle.cpython-39.pyc File 47111 bytes June 19 2025 12:11:01.
pickletools.cpython-39.opt-1.pyc File 66306 bytes June 19 2025 12:11:04.
pickletools.cpython-39.opt-2.pyc File 57213 bytes June 19 2025 12:11:07.
pickletools.cpython-39.pyc File 67120 bytes June 19 2025 12:11:01.
pipes.cpython-39.opt-1.pyc File 7808 bytes June 19 2025 12:11:11.
pipes.cpython-39.opt-2.pyc File 4941 bytes June 19 2025 12:11:17.
pipes.cpython-39.pyc File 7808 bytes June 19 2025 12:11:11.
pkgutil.cpython-39.opt-1.pyc File 18579 bytes June 19 2025 12:11:01.
pkgutil.cpython-39.opt-2.pyc File 11880 bytes June 19 2025 12:11:07.
pkgutil.cpython-39.pyc File 18579 bytes June 19 2025 12:11:01.
platform.cpython-39.opt-1.pyc File 26429 bytes June 19 2025 12:11:01.
platform.cpython-39.opt-2.pyc File 18361 bytes June 19 2025 12:11:07.
platform.cpython-39.pyc File 26429 bytes June 19 2025 12:11:01.
plistlib.cpython-39.opt-1.pyc File 23509 bytes June 19 2025 12:11:04.
plistlib.cpython-39.opt-2.pyc File 21150 bytes June 19 2025 12:11:07.
plistlib.cpython-39.pyc File 23560 bytes June 19 2025 12:11:00.
poplib.cpython-39.opt-1.pyc File 13670 bytes June 19 2025 12:11:00.
poplib.cpython-39.opt-2.pyc File 8740 bytes June 19 2025 12:11:07.
poplib.cpython-39.pyc File 13670 bytes June 19 2025 12:11:00.
posixpath.cpython-39.opt-1.pyc File 10622 bytes June 19 2025 12:11:04.
posixpath.cpython-39.opt-2.pyc File 8907 bytes June 19 2025 12:11:07.
posixpath.cpython-39.pyc File 10622 bytes June 19 2025 12:11:01.
pprint.cpython-39.opt-1.pyc File 16810 bytes June 19 2025 12:11:04.
pprint.cpython-39.opt-2.pyc File 14653 bytes June 19 2025 12:11:07.
pprint.cpython-39.pyc File 16843 bytes June 19 2025 12:11:01.
profile.cpython-39.opt-1.pyc File 14236 bytes June 19 2025 12:11:04.
profile.cpython-39.opt-2.pyc File 11258 bytes June 19 2025 12:11:07.
profile.cpython-39.pyc File 14424 bytes June 19 2025 12:11:01.
pstats.cpython-39.opt-1.pyc File 23765 bytes June 19 2025 12:11:01.
pstats.cpython-39.opt-2.pyc File 20856 bytes June 19 2025 12:11:07.
pstats.cpython-39.pyc File 23765 bytes June 19 2025 12:11:01.
pty.cpython-39.opt-1.pyc File 3969 bytes June 19 2025 12:11:00.
pty.cpython-39.opt-2.pyc File 3124 bytes June 19 2025 12:11:07.
pty.cpython-39.pyc File 3969 bytes June 19 2025 12:11:00.
py_compile.cpython-39.opt-1.pyc File 7409 bytes June 19 2025 12:11:10.
py_compile.cpython-39.opt-2.pyc File 3671 bytes June 19 2025 12:11:16.
py_compile.cpython-39.pyc File 7409 bytes June 19 2025 12:11:10.
pyclbr.cpython-39.opt-1.pyc File 10462 bytes June 19 2025 12:11:00.
pyclbr.cpython-39.opt-2.pyc File 6861 bytes June 19 2025 12:11:07.
pyclbr.cpython-39.pyc File 10462 bytes June 19 2025 12:11:00.
pydoc.cpython-39.opt-1.pyc File 85441 bytes June 19 2025 12:11:04.
pydoc.cpython-39.opt-2.pyc File 75559 bytes June 19 2025 12:11:07.
pydoc.cpython-39.pyc File 85473 bytes June 19 2025 12:11:01.
queue.cpython-39.opt-1.pyc File 10889 bytes June 19 2025 12:11:11.
queue.cpython-39.opt-2.pyc File 6539 bytes June 19 2025 12:11:17.
queue.cpython-39.pyc File 10889 bytes June 19 2025 12:11:11.
quopri.cpython-39.opt-1.pyc File 5616 bytes June 19 2025 12:11:16.
quopri.cpython-39.opt-2.pyc File 4580 bytes June 19 2025 12:11:17.
quopri.cpython-39.pyc File 5760 bytes June 19 2025 12:11:11.
random.cpython-39.opt-1.pyc File 22056 bytes June 19 2025 12:11:00.
random.cpython-39.opt-2.pyc File 14609 bytes June 19 2025 12:11:07.
random.cpython-39.pyc File 22056 bytes June 19 2025 12:11:00.
re.cpython-39.opt-1.pyc File 14375 bytes June 19 2025 12:11:01.
re.cpython-39.opt-2.pyc File 6037 bytes June 19 2025 12:11:07.
re.cpython-39.pyc File 14375 bytes June 19 2025 12:11:01.
reprlib.cpython-39.opt-1.pyc File 5320 bytes June 19 2025 12:11:04.
reprlib.cpython-39.opt-2.pyc File 5164 bytes June 19 2025 12:11:07.
reprlib.cpython-39.pyc File 5320 bytes June 19 2025 12:11:01.
rlcompleter.cpython-39.opt-1.pyc File 5819 bytes June 19 2025 12:11:16.
rlcompleter.cpython-39.opt-2.pyc File 3156 bytes June 19 2025 12:11:17.
rlcompleter.cpython-39.pyc File 5819 bytes June 19 2025 12:11:16.
runpy.cpython-39.opt-1.pyc File 9398 bytes June 19 2025 12:11:00.
runpy.cpython-39.opt-2.pyc File 6956 bytes June 19 2025 12:11:07.
runpy.cpython-39.pyc File 9398 bytes June 19 2025 12:11:00.
sched.cpython-39.opt-1.pyc File 6646 bytes June 19 2025 12:11:10.
sched.cpython-39.opt-2.pyc File 3618 bytes June 19 2025 12:11:16.
sched.cpython-39.pyc File 6646 bytes June 19 2025 12:11:10.
secrets.cpython-39.opt-1.pyc File 2193 bytes June 19 2025 12:11:01.
secrets.cpython-39.opt-2.pyc File 1135 bytes June 19 2025 12:11:07.
secrets.cpython-39.pyc File 2193 bytes June 19 2025 12:11:01.
selectors.cpython-39.opt-1.pyc File 17258 bytes June 19 2025 12:11:01.
selectors.cpython-39.opt-2.pyc File 13149 bytes June 19 2025 12:11:07.
selectors.cpython-39.pyc File 17258 bytes June 19 2025 12:11:01.
shelve.cpython-39.opt-1.pyc File 9557 bytes June 19 2025 12:11:11.
shelve.cpython-39.opt-2.pyc File 5406 bytes June 19 2025 12:11:17.
shelve.cpython-39.pyc File 9557 bytes June 19 2025 12:11:11.
shlex.cpython-39.opt-1.pyc File 7747 bytes June 19 2025 12:11:15.
shlex.cpython-39.opt-2.pyc File 7189 bytes June 19 2025 12:11:17.
shlex.cpython-39.pyc File 7747 bytes June 19 2025 12:11:15.
shutil.cpython-39.opt-1.pyc File 38510 bytes June 19 2025 12:11:10.
shutil.cpython-39.opt-2.pyc File 26442 bytes June 19 2025 12:11:17.
shutil.cpython-39.pyc File 38510 bytes June 19 2025 12:11:10.
signal.cpython-39.opt-1.pyc File 3019 bytes June 19 2025 12:11:10.
signal.cpython-39.opt-2.pyc File 2795 bytes June 19 2025 12:11:16.
signal.cpython-39.pyc File 3019 bytes June 19 2025 12:11:10.
site.cpython-39.opt-1.pyc File 17023 bytes June 19 2025 12:11:04.
site.cpython-39.opt-2.pyc File 11487 bytes June 19 2025 12:11:10.
site.cpython-39.pyc File 17023 bytes June 19 2025 12:11:04.
smtpd.cpython-39.opt-1.pyc File 26537 bytes June 19 2025 12:11:01.
smtpd.cpython-39.opt-2.pyc File 23917 bytes June 19 2025 12:11:07.
smtpd.cpython-39.pyc File 26537 bytes June 19 2025 12:11:01.
smtplib.cpython-39.opt-1.pyc File 35898 bytes June 19 2025 12:11:04.
smtplib.cpython-39.opt-2.pyc File 19536 bytes June 19 2025 12:11:07.
smtplib.cpython-39.pyc File 35943 bytes June 19 2025 12:11:01.
sndhdr.cpython-39.opt-1.pyc File 7006 bytes June 19 2025 12:11:11.
sndhdr.cpython-39.opt-2.pyc File 5731 bytes June 19 2025 12:11:17.
sndhdr.cpython-39.pyc File 7006 bytes June 19 2025 12:11:11.
socket.cpython-39.opt-1.pyc File 28989 bytes June 19 2025 12:11:16.
socket.cpython-39.opt-2.pyc File 20450 bytes June 19 2025 12:11:17.
socket.cpython-39.pyc File 29013 bytes June 19 2025 12:11:11.
socketserver.cpython-39.opt-1.pyc File 25528 bytes June 19 2025 12:11:15.
socketserver.cpython-39.opt-2.pyc File 14812 bytes June 19 2025 12:11:17.
socketserver.cpython-39.pyc File 25528 bytes June 19 2025 12:11:15.
sre_compile.cpython-39.opt-1.pyc File 14972 bytes June 19 2025 12:11:04.
sre_compile.cpython-39.opt-2.pyc File 14558 bytes June 19 2025 12:11:07.
sre_compile.cpython-39.pyc File 15167 bytes June 19 2025 12:11:01.
sre_constants.cpython-39.opt-1.pyc File 6349 bytes June 19 2025 12:11:01.
sre_constants.cpython-39.opt-2.pyc File 5924 bytes June 19 2025 12:11:07.
sre_constants.cpython-39.pyc File 6349 bytes June 19 2025 12:11:01.
sre_parse.cpython-39.opt-1.pyc File 21785 bytes June 19 2025 12:11:04.
sre_parse.cpython-39.opt-2.pyc File 21737 bytes June 19 2025 12:11:07.
sre_parse.cpython-39.pyc File 21822 bytes June 19 2025 12:11:01.
ssl.cpython-39.opt-1.pyc File 45070 bytes June 19 2025 12:11:04.
ssl.cpython-39.opt-2.pyc File 34086 bytes June 19 2025 12:11:10.
ssl.cpython-39.pyc File 45070 bytes June 19 2025 12:11:04.
stat.cpython-39.opt-1.pyc File 4385 bytes June 19 2025 12:11:10.
stat.cpython-39.opt-2.pyc File 3602 bytes June 19 2025 12:11:16.
stat.cpython-39.pyc File 4385 bytes June 19 2025 12:11:10.
statistics.cpython-39.opt-1.pyc File 31797 bytes June 19 2025 12:11:04.
statistics.cpython-39.opt-2.pyc File 15924 bytes June 19 2025 12:11:07.
statistics.cpython-39.pyc File 31991 bytes June 19 2025 12:11:01.
string.cpython-39.opt-1.pyc File 7178 bytes June 19 2025 12:11:11.
string.cpython-39.opt-2.pyc File 6072 bytes June 19 2025 12:11:17.
string.cpython-39.pyc File 7178 bytes June 19 2025 12:11:11.
stringprep.cpython-39.opt-1.pyc File 9959 bytes June 19 2025 12:11:04.
stringprep.cpython-39.opt-2.pyc File 9741 bytes June 19 2025 12:11:07.
stringprep.cpython-39.pyc File 9999 bytes June 19 2025 12:11:01.
struct.cpython-39.opt-1.pyc File 319 bytes June 19 2025 12:11:01.
struct.cpython-39.opt-2.pyc File 319 bytes June 19 2025 12:11:01.
struct.cpython-39.pyc File 319 bytes June 19 2025 12:11:01.
subprocess.cpython-39.opt-1.pyc File 44323 bytes June 19 2025 12:11:04.
subprocess.cpython-39.opt-2.pyc File 32285 bytes June 19 2025 12:11:07.
subprocess.cpython-39.pyc File 44399 bytes June 19 2025 12:11:00.
sunau.cpython-39.opt-1.pyc File 16830 bytes June 19 2025 12:11:01.
sunau.cpython-39.opt-2.pyc File 12240 bytes June 19 2025 12:11:07.
sunau.cpython-39.pyc File 16830 bytes June 19 2025 12:11:01.
symbol.cpython-39.opt-1.pyc File 2592 bytes June 19 2025 12:11:01.
symbol.cpython-39.opt-2.pyc File 2516 bytes June 19 2025 12:11:07.
symbol.cpython-39.pyc File 2592 bytes June 19 2025 12:11:01.
symtable.cpython-39.opt-1.pyc File 11101 bytes June 19 2025 12:11:16.
symtable.cpython-39.opt-2.pyc File 10372 bytes June 19 2025 12:11:17.
symtable.cpython-39.pyc File 11179 bytes June 19 2025 12:11:11.
sysconfig.cpython-39.opt-1.pyc File 16080 bytes June 19 2025 12:11:10.
sysconfig.cpython-39.opt-2.pyc File 13702 bytes June 19 2025 12:11:17.
sysconfig.cpython-39.pyc File 16080 bytes June 19 2025 12:11:10.
tabnanny.cpython-39.opt-1.pyc File 7078 bytes June 19 2025 12:11:11.
tabnanny.cpython-39.opt-2.pyc File 6145 bytes June 19 2025 12:11:17.
tabnanny.cpython-39.pyc File 7078 bytes June 19 2025 12:11:11.
tarfile.cpython-39.opt-1.pyc File 72822 bytes June 19 2025 12:11:04.
tarfile.cpython-39.opt-2.pyc File 57564 bytes June 19 2025 12:11:07.
tarfile.cpython-39.pyc File 72837 bytes June 19 2025 12:11:01.
telnetlib.cpython-39.opt-1.pyc File 18344 bytes June 19 2025 12:11:01.
telnetlib.cpython-39.opt-2.pyc File 10842 bytes June 19 2025 12:11:07.
telnetlib.cpython-39.pyc File 18344 bytes June 19 2025 12:11:01.
tempfile.cpython-39.opt-1.pyc File 23669 bytes June 19 2025 12:11:00.
tempfile.cpython-39.opt-2.pyc File 17143 bytes June 19 2025 12:11:07.
tempfile.cpython-39.pyc File 23669 bytes June 19 2025 12:11:00.
textwrap.cpython-39.opt-1.pyc File 13476 bytes June 19 2025 12:11:04.
textwrap.cpython-39.opt-2.pyc File 6267 bytes June 19 2025 12:11:07.
textwrap.cpython-39.pyc File 13534 bytes June 19 2025 12:11:00.
this.cpython-39.opt-1.pyc File 1272 bytes June 19 2025 12:11:01.
this.cpython-39.opt-2.pyc File 1272 bytes June 19 2025 12:11:01.
this.cpython-39.pyc File 1272 bytes June 19 2025 12:11:01.
threading.cpython-39.opt-1.pyc File 41729 bytes June 19 2025 12:11:16.
threading.cpython-39.opt-2.pyc File 24542 bytes June 19 2025 12:11:16.
threading.cpython-39.pyc File 42194 bytes June 19 2025 12:11:10.
timeit.cpython-39.opt-1.pyc File 11769 bytes June 19 2025 12:11:01.
timeit.cpython-39.opt-2.pyc File 5915 bytes June 19 2025 12:11:07.
timeit.cpython-39.pyc File 11769 bytes June 19 2025 12:11:01.
token.cpython-39.opt-1.pyc File 2509 bytes June 19 2025 12:11:04.
token.cpython-39.opt-2.pyc File 2476 bytes June 19 2025 12:11:07.
token.cpython-39.pyc File 2509 bytes June 19 2025 12:11:01.
tokenize.cpython-39.opt-1.pyc File 17150 bytes June 19 2025 12:11:16.
tokenize.cpython-39.opt-2.pyc File 13386 bytes June 19 2025 12:11:17.
tokenize.cpython-39.pyc File 17178 bytes June 19 2025 12:11:10.
trace.cpython-39.opt-1.pyc File 19772 bytes June 19 2025 12:11:00.
trace.cpython-39.opt-2.pyc File 16757 bytes June 19 2025 12:11:07.
trace.cpython-39.pyc File 19772 bytes June 19 2025 12:11:00.
traceback.cpython-39.opt-1.pyc File 20453 bytes June 19 2025 12:11:11.
traceback.cpython-39.opt-2.pyc File 11500 bytes June 19 2025 12:11:17.
traceback.cpython-39.pyc File 20453 bytes June 19 2025 12:11:11.
tracemalloc.cpython-39.opt-1.pyc File 17948 bytes June 19 2025 12:11:11.
tracemalloc.cpython-39.opt-2.pyc File 16535 bytes June 19 2025 12:11:17.
tracemalloc.cpython-39.pyc File 17948 bytes June 19 2025 12:11:11.
tty.cpython-39.opt-1.pyc File 1091 bytes June 19 2025 12:11:00.
tty.cpython-39.opt-2.pyc File 982 bytes June 19 2025 12:11:07.
tty.cpython-39.pyc File 1091 bytes June 19 2025 12:11:00.
types.cpython-39.opt-1.pyc File 9249 bytes June 19 2025 12:11:00.
types.cpython-39.opt-2.pyc File 8027 bytes June 19 2025 12:11:07.
types.cpython-39.pyc File 9249 bytes June 19 2025 12:11:00.
typing.cpython-39.opt-1.pyc File 71818 bytes June 19 2025 12:11:16.
typing.cpython-39.opt-2.pyc File 50570 bytes June 19 2025 12:11:17.
typing.cpython-39.pyc File 71948 bytes June 19 2025 12:11:11.
uu.cpython-39.opt-1.pyc File 3860 bytes June 19 2025 12:11:01.
uu.cpython-39.opt-2.pyc File 3616 bytes June 19 2025 12:11:07.
uu.cpython-39.pyc File 3860 bytes June 19 2025 12:11:01.
uuid.cpython-39.opt-1.pyc File 22410 bytes June 19 2025 12:11:04.
uuid.cpython-39.opt-2.pyc File 14697 bytes June 19 2025 12:11:07.
uuid.cpython-39.pyc File 22523 bytes June 19 2025 12:11:01.
warnings.cpython-39.opt-1.pyc File 13179 bytes June 19 2025 12:11:04.
warnings.cpython-39.opt-2.pyc File 10904 bytes June 19 2025 12:11:07.
warnings.cpython-39.pyc File 13618 bytes June 19 2025 12:11:01.
wave.cpython-39.opt-1.pyc File 17857 bytes June 19 2025 12:11:04.
wave.cpython-39.opt-2.pyc File 11865 bytes June 19 2025 12:11:07.
wave.cpython-39.pyc File 17886 bytes June 19 2025 12:11:01.
weakref.cpython-39.opt-1.pyc File 20284 bytes June 19 2025 12:11:16.
weakref.cpython-39.opt-2.pyc File 16999 bytes June 19 2025 12:11:16.
weakref.cpython-39.pyc File 20298 bytes June 19 2025 12:11:10.
webbrowser.cpython-39.opt-1.pyc File 17130 bytes June 19 2025 12:11:16.
webbrowser.cpython-39.opt-2.pyc File 14720 bytes June 19 2025 12:11:17.
webbrowser.cpython-39.pyc File 17147 bytes June 19 2025 12:11:11.
xdrlib.cpython-39.opt-1.pyc File 8256 bytes June 19 2025 12:11:16.
xdrlib.cpython-39.opt-2.pyc File 7771 bytes June 19 2025 12:11:17.
xdrlib.cpython-39.pyc File 8256 bytes June 19 2025 12:11:16.
zipapp.cpython-39.opt-1.pyc File 5998 bytes June 19 2025 12:11:01.
zipapp.cpython-39.opt-2.pyc File 4822 bytes June 19 2025 12:11:07.
zipapp.cpython-39.pyc File 5998 bytes June 19 2025 12:11:01.
zipfile.cpython-39.opt-1.pyc File 59563 bytes June 19 2025 12:11:16.
zipfile.cpython-39.opt-2.pyc File 50575 bytes June 19 2025 12:11:17.
zipfile.cpython-39.pyc File 59584 bytes June 19 2025 12:11:16.
zipimport.cpython-39.opt-1.pyc File 17172 bytes June 19 2025 12:11:16.
zipimport.cpython-39.opt-2.pyc File 13654 bytes June 19 2025 12:11:16.
zipimport.cpython-39.pyc File 17250 bytes June 19 2025 12:11:10.

Reading File: //opt//alt/python39/lib64/python3.9/__pycache__/_pydecimal.cpython-39.pyc

a

XC?h:}�
@spdZgd�ZeZdZdZdZddlZddlZ	ddl
Z
zddlmZ
e
dd	�ZWneyhd
d�ZYn0dZd
ZdZdZdZdZdZdZdZdZe
jdkr�dZdZdZndZdZdZeedZGdd�de�Z Gdd�de �Z!Gdd �d e �Z"Gd!d"�d"e"�Z#Gd#d$�d$e e$�Z%Gd%d&�d&e"�Z&Gd'd(�d(e"e$�Z'Gd)d*�d*e �Z(Gd+d,�d,e"�Z)Gd-d.�d.e �Z*Gd/d0�d0e �Z+Gd1d2�d2e(e*�Z,Gd3d4�d4e(e*e+�Z-Gd5d6�d6e e.�Z/e!e%e(e,e*e-e"e+e/g	Z0e#e"e&e"e'e"e)e"iZ1eeeeeeeefZ2ddl3Z3e3�4d7�Z5d8d9�Z6d:d;�Z7[3d�d<d=�Z8Gd>d?�d?e9�Z:d�dAdB�Z;e	j<�=e:�GdCdD�dDe9�Z>GdEdF�dFe9�Z?GdGdH�dHe9�Z@d�dIdJ�ZAeBjCZDdKdL�ZEdMdN�ZFdOdP�ZGdQdR�ZHd�dTdU�ZIdVdW�ZJdXdY�ZKGdZd[�d[e9�ZLeL�jMZNd�d\d]�ZOd^d_�ZPd`da�ZQdbdcdddedfdgdhdidjdk�	fdldm�ZRd�dndo�ZSd�dpdq�ZTe?dree%e,e"ggdsdtdddu�ZUe?dvee%e,e"e!e-ggdw�ZVe?dveggdw�ZWddlXZXeX�YdxeXjZeXj[B�j\Z]eX�Ydy�j\Z^eX�Ydz�j\Z_eX�Yd{eXjZeXj`B�Za[XzddlbZcWne�y�Yn0d�d|d}�Zdd~d�Zed�d��Zfd�d�d��Zgd�d��Zhd�d��Zie:d��Zje:d��Zke:d��Zle:d�Zme:d�Zne:d��ZoejekfZpe
jqjrZse
jqjtZue
jqjvZwexdiesd�es�Zy[
dS)�a�	
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
)%�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplerzsign digits exponentcGs|S�N�)�argsr)r)�//opt/alt/python39/lib64/python3.9/_pydecimal.py�<lambda>��r,rrrrrrrrTl����l��N�Zol������N�Zoi@�Ti����c@seZdZdZdd�ZdS)ra1Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    cGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__�__doc__r2r)r)r)r+r�src@seZdZdZdS)ra)Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    N�r4r5r6r7r)r)r)r+r�src@seZdZdZdd�ZdS)r	a0An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sr	c@seZdZdZdd�ZdS)rz�Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    cGstSr(�r>r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsrc@seZdZdZdd�ZdS)r
a�Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

sr
c@seZdZdZdd�ZdS)rz�Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsrc@seZdZdZdd�ZdS)rz�Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%src@seZdZdZdS)ra�Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    Nr8r)r)r)r+r0src@seZdZdZdd�ZdS)ra�Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<s
rc@seZdZdZdS)ra�Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    Nr8r)r)r)r+rJsrc@seZdZdZdS)r
a�Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    Nr8r)r)r)r+r
Vsr
c@seZdZdZdd�ZdS)raNumerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    cGs�|jttttfvrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrrArr:�prec�EmaxrrBr)r)r+r2ws �
�
�zOverflow.handleNr3r)r)r)r+rasrc@seZdZdZdS)raxNumerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    Nr8r)r)r)r+r�src@seZdZdZdS)ra�Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    Nr8r)r)r)r+r�srZdecimal_contextcCs6z
t��WSty0t�}t�|�|YS0dS)z�Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    N)�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

rcCs,|tttfvr|��}|��t�|�dS)z%Set this thread's context to context.N)rrr�copy�clear_flagsrHrKrLr)r)r+r�srcCs|durt�}t|�S)abReturn a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    N)r�_ContextManager)�ctxr)r)r+r�s$rc
@s�eZdZdZdZd�dd�Zedd��Zd	d
�Zdd�Z	d�d
d�Z
dd�Zdd�Zdd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d3d4�Zd�d5d6�ZeZ�dd7d8�Z�dd9d:�Z �dd;d<�Z!e!Z"�dd=d>�Z#d?d@�Z$�ddAdB�Z%�ddCdD�Z&�ddEdF�Z'�ddGdH�Z(�ddIdJ�Z)�d	dKdL�Z*�d
dMdN�Z+�ddOdP�Z,dQdR�Z-dSdT�Z.e.Z/e0dUdV��Z1e0dWdX��Z2dYdZ�Z3d[d\�Z4d]d^�Z5d_d`�Z6dadb�Z7dcdd�Z8dedf�Z9dgdh�Z:didj�Z;dkdl�Z<dmdn�Z=dodp�Z>e?e7e8e9e:e;e<e=e>dq�Z@�ddrds�ZAdtdu�ZBdvdw�ZC�d
dxdy�ZD�ddzd{�ZEd|d}�ZF�dd~d�ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJ�dd�d��ZKd�d��ZLd�d��ZM�dd�d��ZN�dd�d��ZOeOZP�dd�d��ZQ�dd�d��ZR�dd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZW�dd�d��ZX�dd�d��ZY�dd�d��ZZd�d��Z[d�d��Z\�dd�d��Z]�dd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zb�dd�d��Zcd�d��Zdd�d��Zed�d��Zf�dd�d��Zgd�d��Zhd�d��Zi�d d�dÄZjd�dńZk�d!d�dDŽZl�d"d�dɄZmd�d˄Znd�d̈́Zo�d#d�dτZp�d$d�dфZq�d%d�dӄZr�d&d�dՄZs�d'd�dׄZt�d(d�dلZu�d)d�dۄZv�d*d�d݄Zw�d+d�d߄Zx�d,d�d�Zyd�d�Zz�d-d�d�Z{�d.d�d�Z|�d/d�d�Z}d�d�Z~d�d�Zd�d�Z��d0d�d�Z�dS(1rz,Floating point class for decimal arithmetic.)�_expr<r;�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|durP|dur@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d	�}|dur�|�
d
�p�d}t|�
d�p�d�}tt||��|_
|t|�|_d
|_nZ|�
d�}|du�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d
|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d
|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddv�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddv�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d
|_ntd��|St|t��rx|du�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)a�Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
        Decimal('3.14')
        �_�NzInvalid literal for Decimal: %rrC�-r.r&�intZfrac�exprSF�diag�signal�Nr9�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r9r[zUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr;rWr<�lenrQrR�lstrip�absr�_WorkReprCrX�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrXrY�digitsZdigitr)r)r+rd
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tur�|S||�SdS)a.Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        r&r.g�?�zargument must be int or float.N)rerWrfrnrv�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrxr:r)ry�frC�k�coeffr9�d�resultr)r)r+rw�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)zrReturns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        r9r.r[r_r&)rRrQ)r0rXr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)zyReturns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        r\���r.r&)rQr;�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|durd}n|��}|s&|rx|dur4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)z�Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        NFr_�sNaNr&)r�rrjr	r=)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|durt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)aCVersion of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        Nzcomparison involving sNaNzcomparison involving NaNr&)rrR�is_snanrjr	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS)zuReturn True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        rS�rRr<r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)z�Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only.r&r�r.rSN)rRr�r;�adjustedr<rQ)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tur|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tur|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r?r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tur|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tur|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tur|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S)z�Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        T��raiseit)�_convert_otherrRr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.r&�
r����)
rRr�rx�is_nan�_PyHASH_NANr;�_PyHASH_INFrQ�pow�_PyHASH_MODULUS�
_PyHASH_10INVrWr<)r0Zexp_hashZhash_r?r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�S)zeRepresents the number as a triple tuple.

        To show the internals exactly as they are.
        )rr;rqrurWr<rQr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)a�Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior^r&r�r.r)
rRr�rr�
OverflowErrorrWr<rQ�minr�r;)r0r9r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)z0Represents the number as an instance of Decimal.z
Decimal('%s'))rfr�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|du�r8t�}ddg|jd||}||||S)z�Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        rUrVr\ZInfinityr9�NaNr�r&���r.rSr]�.N�e�Ez%+d)r;rRrQr<rlr�capitals)	r0�engr1rC�
leftdigits�dotplacer|r}rXr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)a,Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        T)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dur(t�}|s@|jtkr@|��}n|��}|�|�S)zRReturns a copy with the sign switched.

        Rounds, if it has reason.
        rLN)rRr�rrEr�copy_abs�copy_negate�_fix�r0r1r?r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dur(t�}|s@|jtkr@|��}nt|�}|�|�S)zhReturns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        rLN)rRr�rrErr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|S)z�Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        rL)r�rRr�r;r�r�)r0�roundr1r?r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tur|S|dur"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)zbReturns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        Nz
-INF + INFr&r.rS)r&r&)r�r�rrRr�r�r;rjr	rr�rQrErr:r��maxrF�_rescalero�
_normalizerCrWrX)
r0r�r1r?rXZnegativezerorC�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tur|S|js |jr6|j||d�}|r6|S|j|��|d�S)zReturn self - otherrL)r�r�rRr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tur|S|j||d�S)zReturn other - selfrL)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tur|S|dur"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)z\Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        Nz(+-)INF * 0z0 * (+-)INFrS�1)r�r�rr;rRr�r�rjr	rArQr:r�r<rorfrW)r0r�r1Z
resultsignr?Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|turtS|dur"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd	||	j�\}}
nt|j|	jd	|�\}}
|
�rt|d
dk�r�|d7}n8|j|j}||k�r�|d	dk�r�|d	}|d7}�q�t|t|�|�}|�|�S)zReturn self / other.Nz(+-)INF/(+-)INFzDivision by infinityrSz0 / 0zx / 0r&r.r�r)r�r�rr;rRr�r�rjr	rArr:�Etinyrr
rQrlr<rFro�divmodrWrfr�)r0r�r1rCr?rXr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)z�Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        r�rSr&r�z%quotient too large in //, % or divmod)r;r�rQr�r�r:r�rErFrorXrWr�rfrjr)r0r�r1rCr��expdiffr�r��q�rr?r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tur|S|j||d�S)z)Swaps self/other and returns __truediv__.rL)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tur|S|dur"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)z6
        Return (self // other, self % other)
        Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r;r�rjr	rArr
r�r�)r0r�r1r?rCZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tur|S|j||d�S)z(Swaps self/other and returns __divmod__.rL)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tur|S|dur"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)z
        self % other
        Nr�r�z0 % 0r.)
r�r�rr�r�rjr	rr�r�)r0r�r1r?r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tur|S|j||d�S)z%Swaps self/other and returns __mod__.rL)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|durt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|d	kr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd
|j|j9_n|jd
|j|j9_t|j|j�\}}	d|	|d@|jk�r~|	|j8}	|d7}|d
|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)
zI
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rSr.r�r�r_r&)rr�r�r�rjr	rrr�r�rQr:r;r�rFrr�rErorXrWr�rf)r0r�r1r?�ideal_exponentr�r�r�r�r�rCr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tur|S|dur"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)z
self // otherNz
INF // INFr�z0 // 0r&)r�r�rr�r�rjr	rAr;r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tur|S|j||d�S)z*Swaps self/other and returns __floordiv__.rL)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�rrr;rfrv�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�NrS)	rRr�rrr�r�r;rQrWr<r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S)Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrvr�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)z2Decapitate the payload of a NaN to fit the contextNrST)	r<rF�clamprlrmr:r;rQr)r0r1ZpayloadZmax_payload_lenr)r)r+r=qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)z�Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        rS�
above Emaxr&r�r.Nr�)rRr�r=rr��EtoprGr�r�r�rQrjrr:r;rlr<rFrrr�_pick_rounding_functionrErfrWrr
)r0r1r�r��exp_maxZnew_expZexp_minr?Zself_is_subnormalr~Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)z(Also known as round-towards-0, truncate.r&r�N)�
_all_zerosr<�r0rFr)r)r+�_round_down�szDecimal._round_downcCs|�|�S)zRounds away from 0.)r�r�r)r)r+�	_round_up�szDecimal._round_upcCs*|j|dvrdSt|j|�r"dSdSdS)zRounds 5 up (away from 0)Z56789r.r&r�N)r<r�r�r)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)zRound 5 downr�N��_exact_halfr<rr�r)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddvr*dS|�|�SdS)z!Round 5 to even, rest to nearest.r&r.�02468r�Nrr�r)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdS)z(Rounds up (not away from 0 if negative.)N�r;r�r�r)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdS)z'Rounds down (not towards 0 if negative)Nrr�r)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddvr |�|�S|�|�SdS)z)Round down unless digit prec-1 is 0 or 5.r.Z05N)r<r�r�r)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dur2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)a�Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rerWrxr:�quantizerRr�rrr�r�r)r0r9rXr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        rrr&)rRr�rrr�rWr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        rrr&)rRr�rrr�rWr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dur2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td	�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)
a:Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        Tr�Nr[r�r9r\zINF * 0 in fmaz0 * INF in fma)
r�rRrrQrjr	rAr;r:rfrWr<r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tur|St|�}|tur(|S|dur6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td	�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td
|j|�|}t|	j�D]}
t|d
|�}�q�t||	j
|�}t|t|�d�S)z!Three argument version of __pow__Nr_r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rjr	r=�
_isintegerr�rF�_isevenr;rnrWro�to_integral_valuer�rX�ranger:rf)r0r��modulor1r�r�Z
modulo_is_nanrC�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dv�r�||@|k�rBdSt	|�d}
|dd	}|t
t|��k�rpdSt|
||�}
t|||�}|
du�s�|du�r�dS|
|k�r�dSd
|
}n�|d
k�r�t	|�dd	}
t
d
|
|�\}}|�r�dS|d
dk�r|d
}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
du�sf|du�rjdS|
|k�rxdSd
|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d
|d
k�r\dk�rtnn|d
}|d
}�q<|d
|d
k�r�dk�r�nn|d
}|d
}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||dt|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)ahAttempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation.r�r&r.Nr�rS)r_����]�Ar�r]r_�d)rorWrXrCrr;rQr�r:�_nbitsrlrf�_decimal_lshift_exactr�rn�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�r{r9Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dur|�|||�St|�}|tur*|S|dur8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|du�r�|�||jd�}|du�r�|dk�r�td|j|j�}d	}	|du�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d
}t||||||�\}}|ddtt|��|d�r�q(|d
7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d
|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)aHReturn self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrSr�FTr]rr�r�)*rr�r�rr�rjr	�_Oner;rrr�r:rAr�rFrWrQrrr��_log10_exp_boundrlrfrGr�r/r<rorXrC�_dpowerrMrN�_signals�trapsr��flagsr
rrr)r0r�rr1r?Zresult_signZ
multiplierrXZself_adj�exact�boundr�r&r'r(r)r*r+r,�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tur|S|j||d�S)z%Swaps self/other and returns __pow__.rL)r�r�r9r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|durt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0NrLrSr&r.)
rrRr�r�r�r:r;rGr�r�rlr<rQ)r0r1r?�dupr��endrXr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|durt�}|dur(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td	�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td	�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)
z�Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        Tr�Nzquantize with one INFz)target exponent out of bounds in quantizerSz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrErRr�r�rrjr	r�rQrGr:r;r�r�rFr�rlr<�Eminr
rr)r0rXrEr1r?r�r)r)r+r
�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkS)a=Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        Tr�)r�rRr��is_infiniterQr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)asRescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        rSr&r�r.N)
rRrr:r;rQr<rlr�rfrW)r0rXrEr~Z
this_functionr�r�r)r)r+r�4
s$
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)a"Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        r&z'argument should be at least 1 in _roundr.)rrrRrr�r�)r0�placesrEr?r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|durTt�}|durb|j}|�d|�}||kr�|�	t
�|�	t�|S)aVRounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        rLr&rSN)rRr�rrQr:r;rrEr�rjrr�r0rEr1r?r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|durt�}|dur|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)z@Rounds to the nearest integer, without raising inexact, rounded.NrLr&)rrErRr�rrQr�rCr)r)r+r�
s
zDecimal.to_integral_valuecCs�|durt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d	|9}d
}	nt|d	|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|ddk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)zReturn the square root of self.NrLr&rSr_r.zsqrt(-x), x > 0r�r"Tr)rrRr�r�r;rr:rQr�rjr	rFrorXrWrlr<r�rf�
_shallow_copy�
_set_roundingrrE)r0r1r?rF�opr��c�lr�r6r�r9r�rEr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|durt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r��r�rrRr�r�r�r��
compare_total�r0r�r1ZsnZonrHr?r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|durt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r�rKrMr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)z"Returns whether self is an integerFr&TNrS)rRrQr<rl)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdvS)z:Returns True if self is even.  Assumes self is an integer.r&Tr�r)rQr<r�r)r)r+rUszDecimal._isevencCs0z|jt|j�dWSty*YdS0dS)z$Return the adjusted exponent of selfr.r&N)rQrlr<rxr�r)r)r+r�[szDecimal.adjustedcCs|S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S)z�Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        Tr�rL)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)z�Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        Tr�r.r_)	r�r;�_NegativeOner0r�rlr<�_ZerorQ)r0r�r1rCZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rLwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�S)z�Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�r�rL)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�S)z'Returns a copy with the sign set to 0. r&)r:r<rQrRr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)z&Returns a copy with the sign inverted.r&r.N)r;r:r<rQrRr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�S)z$Returns self with the sign of other.Tr�)r�r:r;r<rQrRr�r)r)r+�	copy_sign�s
�zDecimal.copy_signcCs�|durt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd	|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d
dt	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)zReturns e ** self.NrLr�r.r&r]r�rSrDrr�)rr�r�rRr0rrFr�r;rlrfrGr:r�rorWrXrC�_dexprErFrr�rE)r0r1r?r&�adjrGrHr�r8r�rXrEr)r)r+rX�sH$( "

zDecimal.expcCsdS)z�Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        Tr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jS)z�Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        )rRr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)z8Return True if self is infinite; otherwise return False.r\�rQr�r)r)r+r?7szDecimal.is_infinitecCs
|jdvS)z>Return True if self is a qNaN or sNaN; otherwise return False.rarZr�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|durt�}|j|��kS)z?Return True if self is a normal number; otherwise return False.FN)rRrr>r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)z;Return True if self is a quiet NaN; otherwise return False.r9rZr�r)r)r+r�GszDecimal.is_qnancCs
|jdkS)z8Return True if self is negative; otherwise return False.r.)r;r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)z?Return True if self is a signaling NaN; otherwise return False.r[rZr�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|durt�}|��|jkS)z9Return True if self is subnormal; otherwise return False.FN)rRrr�r>r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkS)z6Return True if self is a zero; otherwise return False.rSr�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)z�Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        r.�r�r�r�r&�rQrlr<rfrorWrX�r0rWrGrHr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|durt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|d	k�tt|��|�}|��}|�t�}	|�|�}|	|_|S)
z/Returns the natural (base e) logarithm of self.NrLr.zln of a negative valuer_rr�r]r&)rr��_NegativeInfinityr��	_Infinityr0rRr;rjr	rorWrXrFrc�_dlogrlrfrnr:rErFrr�rE�
r0r1r?rGrHr�r&rAr�rEr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	z�Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        r.r�r�r&r���r_Z231r`rar)r)r+r1�szDecimal._log10_exp_boundc
CsF|durt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|d	d
t	tt|���|dr��q|d7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)z&Returns the base 10 logarithm of self.NrLr.zlog10 of a negative valuer&r�rSr_rr�r])rr�rdr�rer;rjr	r<rlrrQrorWrXrFr1�_dlog10rfrnr:rErFrr�rErgr)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dur"t�}|��r.tS|s@|�tdd�St|���}|�|�S)aM Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        rLNzlogb(0)r.)	r�rr�rerjr
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dvrdSqdS)z�Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        r&FZ01T)r;rQr<)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rS)rFrl)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|durt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'and' operation between self and other's digits.NTr�rUcSs$g|]\}}tt|�t|�@��qSr)�rfrW��.0r.�br)r)r+�
<listcomp>B
r-z'Decimal.logical_and.<locals>.<listcomp>r&rS�rr�rnrjr	rqr<rt�zipr:rm�r0r�r1rorpr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|durt�}|�tdd|jd�|�S)zInvert all its digits.Nr&r�)r�logical_xorr:rFr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|durt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z:Applies an 'or' operation between self and other's digits.NTr�rUcSs$g|]\}}tt|�t|�B��qSr)rrrsr)r)r+rvZ
r-z&Decimal.logical_or.<locals>.<listcomp>r&rSrwryr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|durt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'xor' operation between self and other's digits.NTr�rUcSs$g|]\}}tt|�t|�A��qSr)rrrsr)r)r+rvk
r-z'Decimal.logical_xor.<locals>.<listcomp>r&rSrwryr)r)r+r{]
s
zDecimal.logical_xorcCs�t|dd�}|durt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�S�z8Compares the values numerically with their sign ignored.Tr�Nr.r&r��	r�rrRr�r�r�r�r�rLrMr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|durt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�Sr~rrMr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|durt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the largest representable number smaller than itself.NrLr�r.r&rDr�)rr�r�rdr:rFr�rMrFr�_ignore_all_flagsr�r�r��r0r1r?Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|durt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the smallest representable number larger than itself.NrLr.r�rDr&r�)rr�r�rer:rFr�rMrFrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|durt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)a�Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        Tr�Nr&r�z Infinite result from next_toward)r�rr�r�rUr�r�r�rjrr;rrr�r>rr
r)r0r�r1r?Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|d	ur\t�}|j|d
�rv|jrrdSdS|jr�d
SdSd	S)aReturns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        r�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZeroNrLz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r^r;rr])r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S)z'Just returns 10, as this is Decimal, :)r�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|durt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S)z5Returns a rotated copy of self, value-of-other times.NTr�r&rS�rr�r�rQrjr	rFrWr�rr<rlr:r;rm)r0r�r1r?�torot�rotdig�topadZrotatedr)r)r+�rotate4s.

 
�zDecimal.rotatecCs�|durt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)z>Returns self operand after adding the second value to its exp.NTr�r&r�r_)rr�r�rQrjr	rGrFrWr�rr:r;r<r�)r0r�r1r?ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|durt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�S)z5Returns a shifted copy of self, value-of-other times.NTr�r&rSr�)r0r�r1r?r�r�r�Zshiftedr)r)r+r�ns4

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rfr�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tur|S|�t|��Sr(��typerr�rfr�r)r)r+�__copy__�szDecimal.__copy__cCst|�tur|S|�t|��Sr(r�)r0�memor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|durt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddurvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|du�r|dd	vr�|�
|d
|�}nF|ddvr�|�||�}n*|ddv�rt|j
�|k�r|�
||�}|�s@|jd
k�r@|ddv�r@|�d
|�}|jt|j
�}	|dd	v�r~|�sx|du�rxd
|}
nd
}
nB|ddv�r�|	}
n.|ddv�r�|jd
k�r�|	dk�r�|	}
nd
}
|
d
k�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)a|Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        N)�_localeconvr��%�g�Gr_�	precision�eEr.zfF%ZgGr&r�rSrU)r�_parse_format_specifierrR�_format_signr;rfr��
_format_alignr�r:r<rQrErBr�rl�_format_number)r0Z	specifierr1r��specrC�bodyrEr�r�r�r|r}rXr)r)r+�
__format__�sZ
 

zDecimal.__format__)rSN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6r7�	__slots__rd�classmethodrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r=r�r�rrrrrr	r
�dictr�rrrrrr/r9r:r=r
r@r�rBrDr�to_integralrJr�r�rrr�rOrPrLrTr�r�rUrXrXrYr?r�r[r�r\r�r]r^rcrhr1rkrlrnrqrzr|r}r{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V7;!$K



f	�>,UnY="c*"	IK23
.*!'rFcCs&t�t�}||_||_||_||_|S)z�Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    )rcrdrr;r<rQrR)rCZcoefficientrZspecialr0r)r)r+r:�s
r:c@s(eZdZdZdd�Zdd�Zdd�ZdS)	rOz�Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    cCs|��|_dSr()rM�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r7r�r�r�r)r)r)r+rOsrOc	@s�eZdZdZd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZd�dd�Zdd�Zdd�Zdd �ZdZd!d"�Zd#d$�Zd%d&�Zd�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dldm�Z:dndo�Z;dpdq�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAd|d}�ZBd~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVeVZWdS)�ra�Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    Nc
s<zt}
WntyYn0|dur(|n|
j|_|dur<|n|
j|_|durP|n|
j|_|durd|n|
j|_|durx|n|
j|_|dur�|n|
j|_|	dur�g|_n|	|_�dur�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�du�rt�t
d�|_n0t�t��s2t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�v�fVqdSr(�rW�rtr��r4r)r+�	<genexpr>Ir-z#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�v�fVqdSr(r�r��r5r)r+r�Pr-)r�	NameErrorrFrEr>rGr�r��_ignored_flagsr4rMrer�r3�fromkeysr5)r0rFrEr>rGr�r�r5r4r�Zdcr))r5r4r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rerWrxrrrc�__setattr__)r0�namerzZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tvrtd|��qtD]}||vr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rer�rxr3�KeyErrorrcr�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tvr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrFr.r�r>r�r&rGr�r�rEz%s: invalid rounding moder5r4r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrxrcr�r��AttributeError)r0r�rzr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rtZsigr�r)r)r+rv�r-z&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+rv�r-)
r5�itemsr4r�rFrEr>rGr�r�)r0r5r4r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rtr�r�r)r)r+rv�r-z$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rtr�r�r)r)r+rv�r-ztraps=[�))rs�varsr5r�rtr4)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdS)zReset all flags to zeror&Nr��r0�flagr)r)r+rN�s
zContext.clear_flagscCs|jD]}d|j|<qdS)zReset all traps to zeror&Nr�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|S)z!Returns a shallow copy from self.)
rrFrEr>rGr�r�r5r4r��r0Zncr)r)r+rE�s
�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|S)zReturns a deep copy from self.)rrFrEr>rGr�r�r5rMr4r�r�r)r)r+rM�s�zContext.copycGs^t�||�}||jvr*|�j|g|�R�Sd|j|<|j|sR|�j|g|�R�S||��dS)a#Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        r.N)�_condition_maprIr�r2r5r4)r0Z	conditionZexplanationr*�errorr)r)r+rj�s


zContext._raise_errorcCs
|jt�S)z$Ignore all flags, if they are raised)�
_ignore_flagsr3r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�S)z$Ignore the flags, if they are raised)r�rp)r0r5r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dS)z+Stop ignoring the flags, if they are raisedr&N)rerqrpr��remove)r0r5r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�S)z!Returns Etiny (= Emin - prec + 1)r.)rWr>rFr�r)r)r+r��sz
Context.EtinycCst|j|jd�S)z,Returns maximum exponent (= Emax - prec + 1)r.)rWrGrFr�r)r)r+r��szContext.EtopcCs|j}||_|S)a�Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        )rE)r0r�rEr)r)r+rF�szContext._set_roundingrScCsjt|t�r*||��ksd|vr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)z�Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification.rTzAtrailing or leading whitespace and underscores are not permitted.rLzdiagnostic info too long in NaN)rerfrhrjrrr�rlr<rFr�r�)r0rbr�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�S)a�Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        )rrwr�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�S)a[Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        Tr�rL)r�r��r0r.r)r)r+rn!szContext.abscCs8t|dd�}|j||d�}|tur0td|��n|SdS)a�Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        Tr�rL�Unable to convert %s to DecimalN)r�r�r�rx�r0r.rur�r)r)r+�add6s
zContext.addcCst|�|��Sr()rfr�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        z,canonical requires a Decimal as an argument.)rerrxrOr�r)r)r+rONs	
zContext.canonicalcCst|dd�}|j||d�S)a�Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�r��r0r.rur)r)r+r�[s!zContext.comparecCst|dd�}|j||d�S)aCompares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�rPr�r)r)r+rPs zContext.compare_signalcCst|dd�}|�|�S)a+Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        Tr�)r�rLr�r)r)r+rL�szContext.compare_totalcCst|dd�}|�|�S)z�Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�rTr�r)r)r+rT�szContext.compare_total_magcCst|dd�}|��S)aReturns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�S)aReturns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        Tr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��S)a(Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�S)aCopies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        Tr�)r�rUr�r)r)r+rU�szContext.copy_signcCs8t|dd�}|j||d�}|tur0td|��n|SdS)a�Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        Tr�rLr�N)r�r�r�rxr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tur0td|��n|SdS)a/Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        Tr�rLr�N)r�r�r�rxr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tur0td|��n|SdS)a�Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        Tr�rLr�N)r�r�r�rxr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�S)a#Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        Tr�rL)r�rXr�r)r)r+rXWszContext.expcCst|dd�}|j|||d�S)aReturns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        Tr�rL)r�r)r0r.rurHr)r)r+roszContext.fmacCst|t�std��|��S)aReturn True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        z/is_canonical requires a Decimal as an argument.)rerrxrXr�r)r)r+rX�s	
zContext.is_canonicalcCst|dd�}|��S)a,Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        Tr�)r�rYr�r)r)r+rY�szContext.is_finitecCst|dd�}|��S)aUReturn True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        Tr�)r�r?r�r)r)r+r?�szContext.is_infinitecCst|dd�}|��S)aOReturn True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�S)a�Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        Tr�rL)r�r[r�r)r)r+r[�szContext.is_normalcCst|dd�}|��S)aHReturn True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        Tr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��S)a�Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        Tr�)r�r\r�r)r)r+r\�szContext.is_signedcCst|dd�}|��S)aTReturn True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�S)a�Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        Tr�rL)r�r]r�r)r)r+r]szContext.is_subnormalcCst|dd�}|��S)auReturn True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        Tr�)r�r^r�r)r)r+r^%szContext.is_zerocCst|dd�}|j|d�S)a�Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        Tr�rL)r�rhr�r)r)r+rh6sz
Context.lncCst|dd�}|j|d�S)a�Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        Tr�rL)r�rkr�r)r)r+rkLsz
Context.log10cCst|dd�}|j|d�S)a4 Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        Tr�rL)r�rlr�r)r)r+rlhszContext.logbcCst|dd�}|j||d�S)a�Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        Tr�rL)r�rzr�r)r)r+rz�szContext.logical_andcCst|dd�}|j|d�S)aInvert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        Tr�rL)r�r|r�r)r)r+r|�szContext.logical_invertcCst|dd�}|j||d�S)a�Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        Tr�rL)r�r}r�r)r)r+r}�szContext.logical_orcCst|dd�}|j||d�S)a�Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        Tr�rL)r�r{r�r)r)r+r{�szContext.logical_xorcCst|dd�}|j||d�S)a�max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        Tr�rL)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        Tr�rL)r�r�r�r)r)r+r�szContext.max_magcCst|dd�}|j||d�S)a�min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�-szContext.min_magcCst|dd�}|j|d�S)a�Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tur0td|��n|SdS)a�multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        Tr�rLr�N)r�r�r�rxr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�S)a"Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        Tr�rL)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�S)aReturns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        Tr�rL)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�S)a�Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        Tr�rL)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�S)a�normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        Tr�rL)r�r=r�r)r)r+r=�szContext.normalizecCst|dd�}|j|d�S)a�Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        Tr�rL)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�S)a�Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tur2td|��n|SdS)aRaises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        Tr�rLr�N)r�r9r�rx)r0r.rurr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�S)a
Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        Tr�rL)r�r
r�r)r)r+r
es7zContext.quantizecCstd�S)zkJust returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        r�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tur0td|��n|SdS)aReturns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        Tr�rLr�N)r�r�r�rxr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�S)aGReturns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        Tr�rL)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�S)aNReturns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        Tr�rL)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�S)a�Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        Tr�)r�r@r�r)r)r+r@szContext.same_quantumcCst|dd�}|j||d�S)a3Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        Tr�rL)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�S)a{Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        Tr�rL)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�S)a�Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        Tr�rL)r�rJr�r)r)r+rJUszContext.sqrtcCs8t|dd�}|j||d�}|tur0td|��n|SdS)a&Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        Tr�rLr�N)r�r�r�rxr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�S)a�Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        Tr�rL)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�S)zyConverts a number to a string, using scientific notation.

        The operation is not affected by the context.
        Tr�rL)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�S)akRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rDr�r)r)r+rD�szContext.to_integral_exactcCst|dd�}|j|d�S)aLRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rS)N)Xr4r5r6r7r�r�r�r�r�r�r�rNr�rErMr�rjr�r�r�r�r�r�rFr�r�rnr�r�rOr�rPrLrTr�r�r�rUr�r�r�rXrrXrYr?r�r[r�r\r�r]r^rhrkrlrzr|r}r{r�r�r�r�r�r�r�r�r�r=r�r�r�r
r�r�r�r�r@r�r�rJr�r�r�rDrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" rc@s"eZdZdZddd�Zdd�ZdS)ro�rCrWrXNcCsf|durd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r_)rCrWrXrerr;r<rQ)r0rzr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+ro�s
rocCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)zcNormalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    r�r_r.r�)rXrlrfrWr�)r�r�rF�tmpr�Ztmp_lenZ	other_lenrXr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)a Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    r&r�rSN)rfrnrl�rstrip)r9r�Zstr_nZval_nr)r)r+r$(sr$cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)z�Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    r&z3Both arguments to _sqrt_nearest should be positive.r.)rr)r9r.rur)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)z�Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    r.r_r))r'r�rur�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)zaClosest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    r_r.)r�)r.rur�r�r)r)r+�_div_nearestTsr�rc		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)a�Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller.r&r.���r]r�)rnr�r�r�rWrlrfr)	r'�M�Lr*�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r_r.r&r�r")rlrfr�r��
_log10_digits)
rHr�r&rIr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rj�s 

rjc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�S)z�Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r_r.r&r�r")rlrfr�r�rnr�)	rHr�r&rIr�r�r�r8Z	f_log_tenr)r)r+rf�s"rfc@s eZdZdZdd�Zdd�ZdS)�
_Log10Memoizez�Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.cCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r~r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd	�|_t|jd|d
��S)ztGiven an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        r&zp should be nonnegativer]r�r_r"NrSr�r.)rrrlr~rfr�r�r�rW)r0r&r8r�r~r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r7r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)z�Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller).r�r]r.r&r�r_)r#rWrlrfr�r)	r'r�r�r�r�r*ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)a�Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp.r_r&r.r�i�r])r�rlrfr�r�r�r�)	rHr�r&r8r�r�ZcshiftZquotr-r)r)r+rV$srVcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)a5Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    r.r&r�)rlrfrnrfr�rV)r(r)r+r,r&ruZlxcr�Zpcr�rXr)r)r+r2Hs
r2r"�F�5�(�r_�r�r)	r��2�3�4�5�6�7�8rDcCs0|dkrtd��t|�}dt|�||dS)z@Compute a lower bound for 100*log10(c) for a positive integer c.r&z0The argument to _log10_lb should be nonnegative.r")rrrfrl)rHZ
correctionZstr_cr)r)r+r%rsr%cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)z�Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    r�)rerrWrvrwrxr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)z�Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    r&r.rb)rer�_numbersZRationalrRr:r;rfrWr<�denominatorrQ�	numeratorZComplexr�r�rvrr5rrjrwr�)r0r�r�r1r)r)r+r��s(
�
�r�r!i?Bi���)rFrEr4r5rGr>r�r�r`)rFrEr4r5a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|durtd|��|��}|d}|d}|ddu|d<|drv|durbtd|��|durvtd|��|p|d|d<|p�d	|d<|d
dur�d|d
<t|dp�d
�|d<|ddur�t|d�|d<|ddkr�|ddus�|ddvr�d|d<|ddk�rfd|d<|du�r&t��}|ddu�r@td|��|d|d<|d|d<|d|d<n*|ddu�r|d|d<ddg|d<d|d<|S)a�Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rCrV�minimumwidthrSr�r&r�ZgGnr.r9r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrUr]r�)�_parse_format_specifier_regex�matchrr�	groupdictrW�_locale�
localeconv)�format_specr�r{Zformat_dictrr	r)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d	|�||||d	�}ntd
��|S)z�Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    r
rr	�<r�=�^r_NzUnrecognised alignment field)rlrr)	rCr�r�r
rZpaddingr	r�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)zyConvert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    r&)�chain�repeatr�r_Nr�z unrecognised format for grouping)�	itertoolsrrrlr�CHAR_MAXrr)rrrr)r)r+�_group_lengths�s
rcCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)anInsert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    rrr&zgroup length should be positiver.rSN)rrrr�r�rlrsrt�reversed)r~r��	min_width�sepr�groupsrIr)r)r+�_insert_thousands_sep�s $$r#cCs$|rdS|ddvr|dSdSdS)zDetermine sign character.rVrCz +rUNr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddvr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
acFormat a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    Zaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�r
r
)r��formatrlr#r�)r$r|r}rXr�rCZecharr r)r)r+r��s
r�ZInfz-Infr�r�r_)N)F)r&)r)r)FF)F)N)r.)zr7�__all__r4Z	__xname__�__version__Z__libmpdec_version__Zmathr�Znumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrxrr3r�r�ZcontextvarsZ
ContextVarrHrrrrcrr:�Number�registerrOrror�rWr�r#r$r�r�r�r�rjrfr�r�r�r�rVr2r%r�r�rrr�re�compile�VERBOSE�
IGNORECASErrgr�r�DOTALLrZlocalerr�r�rr#r�r�rerdr>rRr0rQrA�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>sbc#

&
���

.
^

0",#
%$+
�

*���
�
�
P
%
)

SILENT KILLER Tool